Ticket #696 (closed defect: fixed)
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
Note: See
TracTickets for help on using
tickets.
