python-2.1 function attributes
Tony J Ibbs (Tibs)
tony at lsl.co.uk
Fri Jan 26 08:24:32 EST 2001
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.
Tibs
--
Tony J Ibbs (Tibs) http://www.tibsnjoan.co.uk/
"How fleeting are all human passions compared with the massive
continuity of ducks." - Dorothy L. Sayers, "Gaudy Night"
My views! Mine! Mine! (Unless Laser-Scan ask nicely to borrow them.)
More information about the Python-list
mailing list