New submission from Michael Foord <[email protected]>:
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 <[email protected]>
<http://bugs.python.org/issue12370>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com