Message76093
################################
# 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; |
|
Date |
User |
Action |
Args |
2008-11-20 10:29:20 | kaizhu | set | recipients:
+ kaizhu |
2008-11-20 10:29:20 | kaizhu | set | messageid: <1227176960.74.0.918534699336.issue4360@psf.upfronthosting.co.za> |
2008-11-20 10:29:19 | kaizhu | link | issue4360 messages |
2008-11-20 10:29:18 | kaizhu | create | |
|