You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inconsistent results with super and __getattribute__ #39013
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2013-02-24.01:08:24.952>created_at=<Date2003-08-05.14:19:12.000>labels= ['interpreter-core', 'type-bug']
title='Inconsistent results with super and __getattribute__'updated_at=<Date2013-02-24.01:08:24.951>user='https://bugs.python.org/grodr'
>>> super(Test, Test2).__getattribute__('n')
<property object at 0x01103300>
>>> super(Test, Test2).__getattribute__('n').__get__(a)
'got ya!'
>>> super(Test, Test2).n
Traceback (most recent call last):
File "<interactive input>", line 1, in ?
AttributeError: 'super' object has no attribute 'n'
The last one is particularly damaging, because:
>>> super(Test2, a).n =32
Traceback (most recent call last):
File "<interactive input>", line 1, in ?
AttributeError: 'super' object has no attribute 'n'
I think the above should work, but whatever’s the
answer, together with the super(Test, Test2) odd
results it does make impossible using super and setting
properties together.
Tested with the latest Python 2.3 in win2k.
With my best regards,
G. Rodrigues
P.S: bug 729913 talks of similar issues at the end: super
does not seem to intercept special methods.
Activity
grodr commentedon Aug 5, 2003
Consider the following scenario of property overriding:
Now, let us override the n property:
So far so good, super is working well with properties. But
now consider the following inconsistencies:
Also:
The last one is particularly damaging, because:
I think the above should work, but whatever’s the
answer, together with the super(Test, Test2) odd
results it does make impossible using super and setting
properties together.
Tested with the latest Python 2.3 in win2k.
With my best regards,
G. Rodrigues
P.S: bug 729913 talks of similar issues at the end: super
does not seem to intercept special methods.
devdanzin commentedon Feb 13, 2009
Same behavior, is this a real issue?
Current exception:
TypeError: 'super' object has only read-only attributes (assign to .n)
BreamoreBoy commentedon Aug 18, 2010
Closed as no response to msg81870.