function attributes are like function objects
fredrik at effbot.org
Thu Feb 1 18:22:45 CET 2001
Michael Hudson wrote:
> > What's so special about functions that we need to
> > be able to plonk arbitrary attributes on them, but
> > not any other builtin types?
> The fact that people were using the one attribute they could get at
> (__doc__) for things far from its original purpose?
well, if people are too lazy to write
a[f] = "something"
do you really think they'll find it much easier to write:
f.a = "something"
(fwiw, I think function attributes is about the dumbest
thing we've added to python lately -- face it, "because
we can" isn't a very good argument when deciding what
to add to the language core...)
More information about the Python-list