[New-bugs-announce] [issue14092] __name__ inconsistently applied in class definition

Lex Berezhny report at bugs.python.org
Thu Feb 23 00:29:08 CET 2012

New submission from Lex Berezhny <eukreign at 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().__name__
>>> F.__name__ = 'Foo'
>>> F.__name__

Works fine for __module__ and others:

>>> class F:
	__module__ = "mod"
>>> F.__module__
>>> 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 <report at bugs.python.org>

More information about the New-bugs-announce mailing list