jython trunk (as of 4271 on java 1.6 on ubuntu feisty) behaves
differently from cpython when the __name__ attribute of a new-style
class is set.
cpython:
Python 2.5.1 (r251:54863, Mar 7 2008, 03:19:34)
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class F(object):
... pass
...
>>> F
<class '__main__.F'>
>>> F.__name__
'F'
>>> F.__name__ = 'P'
>>> F
<class '__main__.P'>
>>> F.__name__
'P'
jython:
Jython 2.3a0 on java1.6.0
Type "copyright", "credits" or "license" for more information.
>>> class F(object):
... pass
...
>>> F.__name__
'F'
>>> F.__name__ = 'G'
>>> F.__name__
'F'
>>> F
<class '__main__.F'>
|