[issue672115] Assignment to __bases__ of direct object subclasses

Amaury Forgeot d'Arc report at bugs.python.org
Fri May 29 16:07:53 CEST 2009


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

Lars, I think that your question has a simple explanation, and is not
related to the original issue:
- On 4th line, the variable named "A" is bound to a new type object.
This type has no attribute by itself.
- The first dir(A) displays the attributes of the bases class, which are
the previous A and B: you see ['one', 'two']
- The second dir(A) displays the attributes of the bases class, which
are B and C: you see ['two', 'three']

The instruction "A = type(...)" causes A to refer to another object; it
does not change the object previously contained in A.

----------
nosy: +amaury.forgeotdarc

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue672115>
_______________________________________


More information about the Python-bugs-list mailing list