Message3949

Author mcella
Recipients mcella
Date 2008-12-17.15:07:31
SpamBayes Score 0.00011637735
Marked as misclassified No
Message-id <1229526452.95.0.330157865598.issue1209@psf.upfronthosting.co.za>
In-reply-to
Content
One very annoying thing I've noticed while working with jython has to do
with equality comparison operations, basically jython traps
AttributeError exceptions that can happen inside the __eq__
implementation and just returns False, while the error is on the
programmer side this behavior is very annoying since it makes almost
impossible to recognize the source of the error (I've lost a good amount
of time to find out my typo on the __eq__ implementation).

I've attached a small test case to show the problem:

$ python test_eq.py 
test... ok

$ jython2.5 test_eq.py
test... failed

Note that here I've tested only __eq__ but I think the problem is more
extended than just __eq__ and is probably related to any special method
(http://docs.python.org/reference/datamodel.html#specialnames).

I haven't yet found the time to also test if properties, getattr,
setattr and hasattr are all coherent with the CPython behavior, I'm
mentioning them since I remember there is something tricky going on
there also, see
http://www.mail-archive.com/python-3000@python.org/msg11630.html for
more links and info.
History
Date User Action Args
2008-12-17 15:07:33mcellasetrecipients: + mcella
2008-12-17 15:07:32mcellasetmessageid: <1229526452.95.0.330157865598.issue1209@psf.upfronthosting.co.za>
2008-12-17 15:07:32mcellalinkissue1209 messages
2008-12-17 15:07:32mcellacreate