Message138670
| Author | michael.foord |
|---|---|
| Recipients | michael.foord |
| Date | 2011-06-19.22:28:29 |
| SpamBayes Score | 0.0027054006 |
| Marked as misclassified | No |
| Message-id | <1308522510.81.0.637011547356.issue12370@psf.upfronthosting.co.za> |
| In-reply-to |
| Content | |
|---|---|
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)) |
|
| History | |||
|---|---|---|---|
| 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 | |