Commit f76037a
authored
frozendict has __new__ overloads for keyword arguments, a mapping and an
iterable of pairs, but also declared 'def __init__(self) -> None: ...',
so type checkers rejected 'frozendict(a=1)' etc. with 'Expected 0
positional arguments'. Remove the redundant __init__ (like other
__new__-constructed builtins) so the __new__ overloads govern
construction. Added a test case.
1 parent eda55c0 commit f76037a
2 files changed
Lines changed: 15 additions & 1 deletion
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1389 | 1389 | | |
1390 | 1390 | | |
1391 | 1391 | | |
1392 | | - | |
1393 | 1392 | | |
1394 | 1393 | | |
1395 | 1394 | | |
| |||
0 commit comments