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
{{ message }}
Repository navigation
False positive overload-overlap with booleans and integer literals #20084
As a workaround, the second one will work if you use Literal[True, False] instead of bool (related to #14764).
Note that ruff (pyupgrade if I remember correctly) can report this as an error (depending on your config, of course). Using literals also tends to negatively affect type-checker analysis times (although it's probably negligible in most cases). So I think that in this case I'd prefer using a classic # type: ignore[overload-overlap] as workaround.
Activity
wyattscarpenter commentedon Oct 18, 2025
As a workaround, the second one will work if you use
Literal[True, False]instead ofbool(related to #14764).jorenham commentedon Oct 18, 2025
Note that ruff (pyupgrade if I remember correctly) can report this as an error (depending on your config, of course). Using literals also tends to negatively affect type-checker analysis times (although it's probably negligible in most cases). So I think that in this case I'd prefer using a classic
# type: ignore[overload-overlap]as workaround.