Jython class names

Robin Becker robin at jessikat.fsnet.co.uk
Tue Sep 9 03:59:24 EDT 2003


I recently came across a problem with porting to Jython

basically the following is prints 1 in CPython, but not in Jython.

class C:
        pass

red = C()
print red.__class__.__name__ is 'C'


it seems that Jython doesn't intern names in the same way or instances
are not constructed in the same way. Is the above test robust or should
I always be using == for testing class names?
-- 
Robin Becker




More information about the Python-list mailing list