[New-bugs-announce] [issue12370] Use of super overwrites use of __class__ in class namespace

Michael Foord report at bugs.python.org
Mon Jun 20 00:28:30 CEST 2011


New submission from Michael Foord <michael at voidspace.org.uk>:

In Python 3 the following code prints "False" because the use of super() has caused the __class__ descriptor to be omitted from the class namespace. Remove the use of super and it prints "True".


class X(object):
    
    def __init__(self):
        super().__init__()
    
    @property
    def __class__(self):
        return int
        
print (isinstance(X(), int))

----------
messages: 138670
nosy: michael.foord
priority: normal
severity: normal
status: open
title: Use of super overwrites use of __class__ in class namespace
type: behavior
versions: Python 3.2, Python 3.3

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


More information about the New-bugs-announce mailing list