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 benjamin.peterson
Recipients amaury.forgeotdarc, benjamin.peterson, brett.cannon, georg.brandl, gvanrossum, isoschiz, mark.dickinson, ncoghlan, pconnell, pitrou, ubershmekel
Date 2013-05-09.23:22:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1368141761.96.0.698986474442.issue17927@psf.upfronthosting.co.za>
In-reply-to
Content
Consider the following testcase

class X:
    def meth(self):
        print(self)
        super()

def f():
    k = X()
    def g():
        return k
    return g
c = f().__closure__[0]
X.meth(c)

With patch
$ ./python unboxing.py 
<cell at 0x7fddacab1eb8: X object at 0x7fddac7876d8>

Without patch
$ ./python unboxing.py
<cell at 0x7f2d0a218eb8: X object at 0x7f2d09eee6d8>
Traceback (most recent call last):
  File "x.py", line 12, in <module>
    X.meth(c)
  File "x.py", line 4, in meth
    super()
TypeError: super(type, obj): obj must be an instance or subtype of type

Maybe you don't care. OTOH, perhaps it could be fixed by checking if the first argument is in fact a closure in super().

In the best world, super() would be syntax instead of a call, and we would just push the __class__ the closure and first argument in the interpreter loop.
History
Date User Action Args
2013-05-09 23:22:42benjamin.petersonsetrecipients: + benjamin.peterson, gvanrossum, brett.cannon, georg.brandl, amaury.forgeotdarc, mark.dickinson, ncoghlan, pitrou, ubershmekel, pconnell, isoschiz
2013-05-09 23:22:41benjamin.petersonsetmessageid: <1368141761.96.0.698986474442.issue17927@psf.upfronthosting.co.za>
2013-05-09 23:22:41benjamin.petersonlinkissue17927 messages
2013-05-09 23:22:41benjamin.petersoncreate