TYP: replace scalar type __init__ with __new__#29629
Conversation
|
Diff from mypy_primer, showing the effect of this PR on type check results on a corpus of open source code: xarray (https://github.com/pydata/xarray)
+ xarray/namedarray/dtypes.py: note: In function "maybe_promote":
+ xarray/namedarray/dtypes.py:86: error: Too many arguments for "generic" [call-arg]
|
Relevant code: https://github.com/pydata/xarray/blob/98732e76481bdf5c497a030657cff32db134e27d/xarray/namedarray/dtypes.py#L48-L86 This new primer error is a true positive. They're calling |
|
Thanks Joren. IIUC, it is up to xarray to fix the problem. |
That's right |
ported from numpy/numtype#692
Long story short; this is why: