This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author james.sanders
Recipients amaury.forgeotdarc, ezio.melotti, james.sanders, r.david.murray
Date 2012-08-24.11:19:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1345807158.4.0.172775075852.issue15753@psf.upfronthosting.co.za>
In-reply-to
Content
Sorry, I wasn't very clear.  super() currently works by assuming that self is the first entry in f_localsplus, which is defeated, for example, by doing:

>>> class A:
...     def f(self):
...             del self
...             super()
... 
>>> A().f()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 4, in f
SystemError: super(): arg[0] deleted
>>> class B:
...     def f(self):
...             self = 1
...             super()
... 
>>> B().f()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 4, in f
TypeError: super(type, obj): obj must be an instance or subtype of type

I don't know if this is the intended behaviour (in which case, my assertion that obj is a tuple should be replaced by just checking whether it is a tuple and raising an exception otherwise; and I suppose the super documentation should mention this caveat), or whether this should be fixed somehow.
History
Date User Action Args
2012-08-24 11:19:18james.sanderssetrecipients: + james.sanders, amaury.forgeotdarc, ezio.melotti, r.david.murray
2012-08-24 11:19:18james.sanderssetmessageid: <1345807158.4.0.172775075852.issue15753@psf.upfronthosting.co.za>
2012-08-24 11:19:17james.sanderslinkissue15753 messages
2012-08-24 11:19:17james.sanderscreate