Message138670
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)) |
|
Date |
User |
Action |
Args |
2011-06-19 22:28:30 | michael.foord | set | recipients:
+ michael.foord |
2011-06-19 22:28:30 | michael.foord | set | messageid: <1308522510.81.0.637011547356.issue12370@psf.upfronthosting.co.za> |
2011-06-19 22:28:30 | michael.foord | link | issue12370 messages |
2011-06-19 22:28:30 | michael.foord | create | |
|