New submission from Lex Berezhny <eukre...@gmail.com>:

The following behavior doesn't make sense, especially since it works correctly 
for other special attributes:

>>> class F:
        __name__ = "Foo"

>>> F.__name__
'F'
>>> F().__name__
'Foo'
>>> F.__name__ = 'Foo'
>>> F.__name__
'Foo'


Works fine for __module__ and others:

>>> class F:
        __module__ = "mod"
        
>>> F.__module__
'mod'
>>> F
<class mod.F at 0x0212B360>

----------
components: Interpreter Core
messages: 154013
nosy: eukreign
priority: normal
severity: normal
status: open
title: __name__ inconsistently applied in class definition
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14092>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to