Commit 298e421
committed
SF patch #685738 by Michael Stone.
This changes the default __new__ to refuse arguments iff tp_init is the
default __init__ implementation -- thus making it a TypeError when you
try to pass arguments to a constructor if the class doesn't override at
least __init__ or __new__.1 parent 0c016a9 commit 298e421
4 files changed
Lines changed: 39 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3694 | 3694 | | |
3695 | 3695 | | |
3696 | 3696 | | |
3697 | | - | |
3698 | | - | |
| 3697 | + | |
| 3698 | + | |
3699 | 3699 | | |
3700 | 3700 | | |
3701 | 3701 | | |
| |||
3705 | 3705 | | |
3706 | 3706 | | |
3707 | 3707 | | |
3708 | | - | |
3709 | | - | |
| 3708 | + | |
| 3709 | + | |
3710 | 3710 | | |
3711 | 3711 | | |
3712 | 3712 | | |
| |||
3715 | 3715 | | |
3716 | 3716 | | |
3717 | 3717 | | |
3718 | | - | |
3719 | | - | |
3720 | | - | |
3721 | | - | |
| 3718 | + | |
| 3719 | + | |
| 3720 | + | |
| 3721 | + | |
3722 | 3722 | | |
3723 | 3723 | | |
3724 | 3724 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
15 | 21 | | |
16 | 22 | | |
17 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2251 | 2251 | | |
2252 | 2252 | | |
2253 | 2253 | | |
| 2254 | + | |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
| 2262 | + | |
| 2263 | + | |
| 2264 | + | |
| 2265 | + | |
| 2266 | + | |
| 2267 | + | |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
| 2271 | + | |
2254 | 2272 | | |
2255 | 2273 | | |
2256 | 2274 | | |
| |||
2487 | 2505 | | |
2488 | 2506 | | |
2489 | 2507 | | |
2490 | | - | |
| 2508 | + | |
2491 | 2509 | | |
2492 | 2510 | | |
2493 | 2511 | | |
| |||
0 commit comments