You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Globally replace all instances of float with FloatInt and of complex with ComplexInt in the stdlib.
After approximately two months do the same for third-party stubs.
Review FloatInt and ComplexInt instances are replace them with the proper types. (This will take a while.)
Remove the type aliases once they are not needed anymore (in 10 years or so ...)
Using FloatInt and ComplexInt would be disallowed for new code and the type aliases should explicitly be marked as not to be used by non-typeshed code.
We should also probably add flake8-pyi checks that checks that argument types use float | int and complex | float | int. Cases where only float/complex is allowed are probably rare.
As discussed in
python/typing#1748: I propose to (slowly) replacefloatwithfloat | intandcomplexwithcomplex | float | int, where applicable.floatis current implicitly equivalent toint | float.This issue proposes an ugly and slow, but correct and safe procedure:
FloatInt = float | intandComplexInt = complex | float | intto_typeshed.Add type aliases
FloatIntandComplexInt#16068floatwithFloatIntand ofcomplexwithComplexIntin the stdlib.FloatIntandComplexIntinstances are replace them with the proper types. (This will take a while.)Using
FloatIntandComplexIntwould be disallowed for new code and the type aliases should explicitly be marked as not to be used by non-typeshed code.We should also probably add flake8-pyi checks that checks that argument types use
float | intandcomplex | float | int. Cases where onlyfloat/complexis allowed are probably rare.