Long names are doom ?
Andrew Dalke
dalke at acm.org
Sat May 26 02:51:42 EDT 2001
Nick Perkins wrote:
>what if you wanted to name, say, a function
>with a string so that you could include spaces?
...
>...just a silly idea.
>ok, i'll go to bed now.
Something like that came up last year, with
the proposed syntax of
obj."attribute with spaces in the name"
As I recall, people thought it interesting, but that's
as far as it went. I don't think there were any
definite implementation reasons against it. But no one
could get a solid reason to have it, and for those
few cases where that functionality was needed
getattr(obj, "attribute with spaces in the name")
works.
BTW, in your proposal,
fn['my special function']()
the [] syntax could be confused with list/dict lookup.
Andrew
dalke at acm.org
More information about the Python-list
mailing list