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.
Created on 2015年04月17日 14:40 by Albert.Zeyer, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Messages (2) | |||
|---|---|---|---|
| msg241335 - (view) | Author: Albert Zeyer (Albert.Zeyer) * | Date: 2015年04月17日 14:40 | |
Code: class C(object): def __init__(self, a, b=2, c=3): pass class D(C): def __init__(self, d, **kwargs): super(D, self).__init__(**kwargs) class E(D): def __init__(self, **kwargs): super(E, self).__init__(**kwargs) E(d=42, b=0, c=0) You get the funny message: TypeError: __init__() takes at least 2 arguments (3 given) |
|||
| msg241338 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2015年04月17日 15:05 | |
This is a well-known shortcoming of 2.x function signature errors. The situation is much improved in 3.x: TypeError: __init__() missing 1 required positional argument: 'a' |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:15 | admin | set | github: 68176 |
| 2015年04月17日 15:05:41 | benjamin.peterson | set | status: open -> closed nosy: + benjamin.peterson messages: + msg241338 resolution: wont fix |
| 2015年04月17日 14:40:27 | Albert.Zeyer | create | |