Ticket #696 (closed defect: fixed)

Opened 2 years ago

Last modified 19 months ago

Implement no-args super() (Py3 feature)

Reported by: scoder Owned by: vitja
Priority: major Milestone: 0.16
Component: Python3 Semantics Keywords:
Cc:

Description (last modified by scoder) (diff)

Hundreds of tests in the Py3k pyregr test suite currently fail with a SystemError:

Traceback (most recent call last):
  File "test_super.py", line 48, in test_super.TestSuper.testBasicsWorking (test_super.cpp:1053)
  File "test_super.py", line 31, in test_super.D.f (test_super.cpp:905)
SystemError: super(): __class__ cell not found

PEP 3135 describes this feature:

 http://www.python.org/dev/peps/pep-3135/

Basically, Cython should inject the reference (not just the name!) to the surrounding class as first call argument to super(), and the first argument of the surrounding method (i.e. "self") as second call argument.

Doing this at compile time is actually safe, as CPython does more or less the same thing. It even checks for a call to a function called "super" at compile time, and the feature fails if "super" happens to be called "_super" ;-)

Change History

Changed 2 years ago by scoder

  • summary changed from super() is broken in latest Py3k to no-args super() is broken in Py3

Changed 2 years ago by scoder

  • summary changed from no-args super() is broken in Py3 to Implement no-args super() (Py3 feature)
  • description modified (diff)
  • milestone changed from wishlist to 1.0

Changed 23 months ago by vitja

  • owner set to vitja

Changed 19 months ago by vitja

  • status changed from new to closed
  • resolution set to fixed
  • milestone changed from 1.0 to 0.16
Note: See TracTickets for help on using tickets.