Uh oh!
There was an error while loading. Please reload this page.
Simplify bool stub - #6782
Conversation
The semantics of this proposed PR should be identical to the existing stub. I'm curious, though, to see whether primer shows false-positives like those we saw in python#6762
Diff from mypy_primer, showing the effect of this PR on open source code: pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/ops/mask_ops.py:58: error: Value of type variable "_B" of "__or__" of "bool" cannot be "ndarray[Any, Any]" [type-var]+ pandas/core/ops/mask_ops.py:181: error: Value of type variable "_B" of "__or__" of "bool" cannot be "ndarray[Any, Any]" [type-var]+ pandas/core/groupby/indexing.py:163: error: Value of type variable "_B" of "__or__" of "bool" cannot be "ndarray[Any, dtype[bool_]]" [type-var]+ pandas/core/groupby/indexing.py:166: error: Value of type variable "_B" of "__or__" of "bool" cannot be "ndarray[Any, dtype[bool_]]" [type-var]+ pandas/core/groupby/indexing.py:175: error: Value of type variable "_B" of "__or__" of "bool" cannot be "ndarray[Any, Any]" [type-var]+ pandas/core/groupby/indexing.py:177: error: Value of type variable "_B" of "__or__" of "bool" cannot be "Union[bool, ndarray[Any, Any]]" [type-var] |
AlexWaygood
commented
Jan 2, 2022
I'll take a look at the |
| _R = TypeVar("_R") # Return-type TypeVar | ||
| _SupportsNextT = TypeVar("_SupportsNextT", bound=SupportsNext[Any], covariant=True) | ||
| _SupportsAnextT = TypeVar("_SupportsAnextT", bound=SupportsAnext[Any], covariant=True) | ||
| _B = TypeVar("_B", bool, int) |
There was a problem hiding this comment.
In my experience mypy does not have ideal support for TypeVars with values (and bugs in this field are really hard to fix!). It might be the root cause in pandas case.
srittau
commented
Jan 2, 2022
Also marking as "deferred" due to mypy problems. |
AlexWaygood
commented
Jan 2, 2022
Agreed, this definitely shouldn't be merged until the errors identified in #6762 are resolved (if at all). |
hauntsaninja
commented
Jan 2, 2022
This is likely the exact same thing as python/mypy#11880 from the other day |
JelleZijlstra
commented
Feb 12, 2022
Seems like this causes new false positives and doesn't actually solve any problem, so maybe we should just close this. (Trying to keep down the list of open PRs.) |
The semantics of this proposed revision should be identical to the existing stub. I'm curious, though, to see whether primer shows false-positives like those we saw in #6762