function attributes are like function objects
aahz at panix.com
Sat Feb 3 01:58:14 EST 2001
In article <mailman.981171622.11894.python-list at python.org>,
Barry A. Warsaw <barry at digicool.com> wrote:
>>>>>> "GG" == Geoffrey Gerrietts <geoff at homegain.com> writes:
> GG> Not to pick nits, just that the question is about
> GG> introspection, not about whether regular namespace semantics
> GG> work, or whether our functions are really first-class objects.
>Okay, so introspection works no differently for functions as any other
>object with writable attributes (e.g. classes, instances, modules).
>You can use getattr() to test whether a function has a particular
>attribute, and setattr() to set that attribute.
I think the issue is that Geoffrey suddenly realized that there's no
"self" equivalent for functions.
--- Aahz (Copyright 2001 by aahz at pobox.com)
Androgynous poly kinky vanilla queer het <*> http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6
"People sometimes focus too much on the fact of communication rather than
the substance of communication." --Dave Morton
More information about the Python-list