Message1148

Author leouserz
Recipients
Date 2006-12-20.19:06:07
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Im trying to figure out the bug here.  From:
http://docs.python.org/lib/built-in-funcs.html

"hasattr(  	object, name)
    The arguments are an object and a string. The result is True if the string is the name of one of the object's attributes, False if not. (This is implemented by calling getattr(object, name) and seeing whether it raises an exception or not.)"

Running this code:
>>> class x:
...    def __getattr__(self, name):
...       print name

and invoking
z = x()
hasattr(z, "something")

produces the same effect on Python as well as Jython.  Im working with a Jython3005.

leouser

History
Date User Action Args
2008-02-20 17:17:30adminlinkissue1501932 messages
2008-02-20 17:17:30admincreate