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 kaizhu
Recipients kaizhu
Date 2008-11-20.10:29:18
SpamBayes Score 2.2244405e-08
Marked as misclassified No
Message-id <1227176960.74.0.918534699336.issue4360@psf.upfronthosting.co.za>
In-reply-to
Content
################################
# super_closure.py
class A(object):
  def foo(self):
    return super()
    # remove the closure below
    # & SystemError goes away ???
    lambda: self
A().foo()
################################

when run on 3.0rc1 & 3.0rc2:

hpc-login2 3 ~/work/py3to2: python3.0 super_closure.py
Traceback (most recent call last):
  File "super_closure.py", line 9, in <module>
    A().foo()
  File "super_closure.py", line 5, in foo
    return super()
SystemError: super(): __class__ is not a type (A)

SystemError seems to b raised from typeobject.c (line6155):

static int
super_init(PyObject *self, PyObject *args, PyObject *kwds)
{...
        if (!PyType_Check(type)) {
            PyErr_Format(PyExc_SystemError,
              "super(): __class__ is not a type (%s)",
              Py_TYPE(type)->tp_name);
            return -1;
        }
        break;
History
Date User Action Args
2008-11-20 10:29:20kaizhusetrecipients: + kaizhu
2008-11-20 10:29:20kaizhusetmessageid: <1227176960.74.0.918534699336.issue4360@psf.upfronthosting.co.za>
2008-11-20 10:29:19kaizhulinkissue4360 messages
2008-11-20 10:29:18kaizhucreate