Message7183

Author adorsk
Recipients adorsk
Date 2012-06-06.15:42:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1338997326.02.0.307996940832.issue1909@psf.upfronthosting.co.za>
In-reply-to
Content
The 'attrgetter' method in the 'operator' library does not appear to function as expected.

Environment: jython2.7a2, w/ OpenJDK-6 on Ubuntu 12.04

Test: try running the code below:

class Foo(object):
    pass

class Bar(object):
    pass

f = Foo()
f.bar = Bar()
f.bar.bat = 5

from operator import attrgetter
print attrgetter("bar.bat")(f) 

----
The result is this error:

Traceback (most recent call last):
  File "t.py", line 13, in <module>
    print attrgetter("bar.bat")(f)
AttributeError: 'Foo' object has no attribute 'bar.bat' 


This specifically causes problems when used with SqlAlchemy 0.7.7, as per this thread:

http://groups.google.com/group/sqlalchemy/browse_thread/thread/8dd77dccad818ba6

PS: I'm just getting into Jython, looks like a very cool tool, and potentially very useful as well.
History
Date User Action Args
2012-06-06 15:42:06adorsksetrecipients: + adorsk
2012-06-06 15:42:06adorsksetmessageid: <1338997326.02.0.307996940832.issue1909@psf.upfronthosting.co.za>
2012-06-06 15:42:05adorsklinkissue1909 messages
2012-06-06 15:42:05adorskcreate