python-2.1 function attributes

Emile van Sebille emile at fenx.com
Fri Jan 26 09:03:05 EST 2001


"Tony J Ibbs (Tibs)" <tony at lsl.co.uk> wrote in message
news:mailman.980515832.8534.python-list at python.org...
> Michael Hudson wrote:
> > How about "having"?
> >
> > def func(param) having (publish=1, secure=0):
> >     """ docco """
> >     print "bobbins"
> >
> > to emphasize the attribute-ness one could use a dot
prefix:
> >
> > def func(param) having (.publish=1, .secure=0):
> >     """ docco """
> >     print "bobbins"
> >
> > I think I like this (though I'm not sure about the dot
> > prefix).  I might see if I can whip up a patch...
>
> Yes, "having" is better than "with". That's neat. And it
doesn't have
> any obvious other meaning for me. (the important thing was
probably
> getting away from "with" - once that's done, if people
really don't like
> "having", suggesting new words is simple enough, at
leisure)
>
> I'm not sure about the dot prefix either - it makes them
obviously odd,
> but feels sort-of unPythonic. I think I prefer without.
>
>

I also like it without the dot, as it opens the door to
allowing *args and **kwargs style parameter passing
interpretation.

--

Emile van Sebille
emile at fenx.com
-------------------







More information about the Python-list mailing list