Message168757
For example:
Python 3.2.2 (default, Feb 10 2012, 09:23:17)
[GCC 4.4.5 20110214 (Red Hat 4.4.5-6)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class A:
... def f(*args):
... print(super().__repr__())
...
>>> A().f()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 3, in f
SystemError: super(): no arguments
(There is no change in the current development version 3.3.0b2+)
I guess that the problem here is related to the fact that the super call makes sense if we call A().f() but not if we call A.f() (which is allowed by the method signature)? I understand that not including self in the signature is almost always bad style, but occasionally it is necessary, for example if you want to allow arbitrary keyword arguments as dict.update does.
Also, how come using the no-argument form of super outside a method raises SystemError - isn't that supposed to be for internal errors? |
|
Date |
User |
Action |
Args |
2012-08-21 11:52:40 | james.sanders | set | recipients:
+ james.sanders |
2012-08-21 11:52:40 | james.sanders | set | messageid: <1345549960.82.0.102703520127.issue15753@psf.upfronthosting.co.za> |
2012-08-21 11:52:40 | james.sanders | link | issue15753 messages |
2012-08-21 11:52:38 | james.sanders | create | |
|