Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix strictGenericNarrowing causing false positive reportUnnecessaryIsInstance errors when narrowing Callable #909

Merged
merged 4 commits into from
Dec 1, 2024

Conversation

This comment has been minimized.

…yIsInstance` errors when narrowing `Callable`
@DetachHead DetachHead force-pushed the fix-strictGenericNarrowing-with-Callable branch from 277696c to fcced9f Compare November 27, 2024 09:05

This comment has been minimized.

@DetachHead DetachHead force-pushed the fix-strictGenericNarrowing-with-Callable branch from 44d2e79 to b3d2a19 Compare December 1, 2024 05:36

This comment has been minimized.

@DetachHead DetachHead force-pushed the fix-strictGenericNarrowing-with-Callable branch from b3d2a19 to 7163a9b Compare December 1, 2024 06:31

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

github-actions bot commented Dec 1, 2024

Diff from mypy_primer, showing the effect of this PR on open source code:

ibis (https://github.com/ibis-project/ibis)
-   /tmp/mypy_primer/projects/ibis/ibis/common/graph.py:196:14 - error: Type "Finder" is not assignable to declared type "(node: Unknown) -> bool"
+   /tmp/mypy_primer/projects/ibis/ibis/common/graph.py:196:14 - error: Type "(Node) -> bool" is not assignable to declared type "(node: Unknown) -> bool"
-     Type "Finder" is not assignable to type "(node: Unknown) -> bool"
+     Type "(Node) -> bool" is not assignable to type "(node: Unknown) -> bool"
-   /tmp/mypy_primer/projects/ibis/ibis/common/graph.py:241:14 - error: Type "Replacer" is not assignable to declared type "(node: Unknown, kwargs: Unknown) -> Unknown"
+   /tmp/mypy_primer/projects/ibis/ibis/common/graph.py:241:14 - error: Type "(Node, dict[Node, Any] | None) -> Node" is not assignable to declared type "(node: Unknown, kwargs: Unknown) -> Unknown"
-     Type "Replacer" is not assignable to type "(node: Unknown, kwargs: Unknown) -> Unknown"
+     Type "(Node, dict[Node, Any] | None) -> Node" is not assignable to type "(node: Unknown, kwargs: Unknown) -> Unknown"

sympy (https://github.com/sympy/sympy)
-   /tmp/mypy_primer/projects/sympy/sympy/parsing/sympy_parser.py:56:35 - warning: Unnecessary isinstance call; "(...) -> object" is never an instance of "Symbol" (reportUnnecessaryIsInstance)
-     Type of "n" is "Unknown | Overload[(n: int = 15, subs: dict[Basic, Basic | float] | None = None, maxn: int = 100, chop: bool = False, strict: bool = False, quad: str | None = None, verbose: bool = False) -> Expr, (n: int = 15, subs: dict[Basic, Basic | float] | None = None, maxn: int = 100, chop: bool = False, strict: bool = False, quad: str | None = None, verbose: bool = False) -> Basic] | Any" (reportUnknownMemberType)
+     Type of "n" is "Unknown | Overload[(n: int = 15, subs: dict[Basic, Basic | float] | None = None, maxn: int = 100, chop: bool = False, strict: bool = False, quad: str | None = None, verbose: bool = False) -> Expr, (n: int = 15, subs: dict[Basic, Basic | float] | None = None, maxn: int = 100, chop: bool = False, strict: bool = False, quad: str | None = None, verbose: bool = False) -> Basic]" (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solveset.py:506:20 - warning: Argument type is unknown
-     Argument type is "Generator[_NotImplementedType | Unknown, None, None]" (reportUnknownArgumentType)
+     Argument type is "Generator[_NotImplementedType | StrictLessThan | Unknown | Equality | Relational | Unequality, None, None]" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solveset.py:706:26 - warning: Argument type is Any
-     Argument corresponds to parameter "f" in function "solveset_real" (reportAny)
-     Type of "number" is "Unknown | One | NegativeOne | Zero | Integer | Rational | NaN | ComplexInfinity | Half | Infinity | NegativeInfinity | Float | _NotImplementedType | Expr" (reportUnknownVariableType)
+     Type of "number" is "Unknown | One | NegativeOne | Zero | Integer | Rational | NaN | ComplexInfinity | Half | Expr" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solveset.py:2793:21 - warning: Argument type is Any
-     Argument corresponds to parameter "f" in function "solveset" (reportAny)
-     Type of "eq" is "_NotImplementedType | Unknown" (reportUnknownVariableType)
+     Type of "eq" is "_NotImplementedType | GreaterThan | Unknown | Equality | Relational | Unequality" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solveset.py:3411:13 - warning: Argument type is Any
-     Argument corresponds to parameter "lhs" in function "__new__" (reportAny)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solveset.py:3513:5 - warning: Type of "e" is partially unknown
+     Type of "e" is "ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half | Unknown | Expr" (reportUnknownVariableType)
-     Type of "ans" is "set[tuple[Any, Any] | tuple[Unknown, Any]]" (reportUnknownVariableType)
+     Type of "ans" is "set[tuple[Any | Unknown, Any] | tuple[Unknown, Any]]" (reportUnknownVariableType)
-     Type of "P" is "(condition: Unknown, given_condition: Unknown | None = None, numsamples: Unknown | None = None, evaluate: bool = True, **kwargs: Unknown) -> (Unknown | Any | BernoulliDistribution | Probability | Zero | One | Expr | Float | ComplexInfinity | Rational | NaN | NegativeOne | Integer | Half | Infinity | NegativeInfinity | _NotImplementedType | Self@Expr | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Lambda | Number | Relational | Unequality | int | None)" (reportUnknownVariableType)
+     Type of "P" is "(condition: Unknown, given_condition: Unknown | None = None, numsamples: Unknown | None = None, evaluate: bool = True, **kwargs: Unknown) -> (Unknown | Any | BernoulliDistribution | Probability | Zero | One | Self@Expr | tuple[Unknown, ...] | Sum | Order | NaN | Piecewise | Basic | Equality | Relational | Unequality | ComplexInfinity | Expr | Float | Half | Infinity | Integer | Lambda | NegativeInfinity | NegativeOne | Number | Rational | int | None)" (reportUnknownVariableType)
-     Type of "correlation" is "(X: Unknown, Y: Unknown, condition: Unknown | None = None, **kwargs: Unknown) -> (Unknown | Expr | Any | ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half | Infinity | NegativeInfinity | Float | _NotImplementedType)" (reportUnknownVariableType)
+     Type of "correlation" is "(X: Unknown, Y: Unknown, condition: Unknown | None = None, **kwargs: Unknown) -> (Unknown | Expr | Any | ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half)" (reportUnknownVariableType)
-     Type of "coskewness" is "(X: Unknown, Y: Unknown, Z: Unknown, condition: Unknown | None = None, **kwargs: Unknown) -> (Unknown | Expr | Any | ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half | Infinity | NegativeInfinity | Float | _NotImplementedType)" (reportUnknownVariableType)
+     Type of "coskewness" is "(X: Unknown, Y: Unknown, Z: Unknown, condition: Unknown | None = None, **kwargs: Unknown) -> (Unknown | Expr | Any | ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half)" (reportUnknownVariableType)
-     Type of "doit" is "((**hints: Unknown) -> Equality) | Unknown | ((**hints: Unknown) -> Relational) | ((**hints: Unknown) -> Unequality) | ((**hints: Unknown) -> NaN) | ((**hints: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Any | Zero | NaN | Piecewise | Basic | None)) | ((**hints: Unknown) -> Unknown)" (reportUnknownMemberType)
+     Type of "doit" is "((**hints: Unknown) -> Equality) | Unknown | ((**hints: Unknown) -> Relational) | ((**hints: Unknown) -> Unequality) | ((**hints: Unknown) -> NaN) | ((**hints: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Any | Zero | NaN | Piecewise | Basic | Equality | Relational | Unequality | None)) | ((**hints: Unknown) -> Unknown)" (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/sympy/sympy/stats/crv_types.py:2542:9 - warning: Return type, "ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half | Unknown | Expr", is partially unknown (reportUnknownParameterType)
+   /tmp/mypy_primer/projects/sympy/sympy/stats/crv_types.py:2542:9 - error: Method "_cdf" overrides class "SingleContinuousDistribution" in an incompatible manner
+     Return type mismatch: base method returns type "None", override returns type "ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half | Unknown | Expr"
+       Type "ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half | Unknown | Expr" is not assignable to type "None"
+         "Expr" is not assignable to "None" (reportIncompatibleMethodOverride)
+   /tmp/mypy_primer/projects/sympy/sympy/stats/crv_types.py:2544:16 - warning: Return type, "ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half | Unknown | Expr", is partially unknown (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/stats/crv_types.py:2721:9 - warning: Return type, "Expr | Rational | NaN | ComplexInfinity | One | NegativeOne | Zero | Integer | Half | Infinity | NegativeInfinity | Float | _NotImplementedType | Unknown", is partially unknown (reportUnknownParameterType)
+   /tmp/mypy_primer/projects/sympy/sympy/stats/crv_types.py:2721:9 - warning: Return type, "Expr | Unknown | NaN | One | NegativeOne | Zero | Integer | Rational | ComplexInfinity | Half", is partially unknown (reportUnknownParameterType)
+   /tmp/mypy_primer/projects/sympy/sympy/stats/crv_types.py:2721:9 - error: Method "_cdf" overrides class "SingleContinuousDistribution" in an incompatible manner
+     Return type mismatch: base method returns type "None", override returns type "Expr | Unknown | NaN | One | NegativeOne | Zero | Integer | Rational | ComplexInfinity | Half"
+       Type "Expr | Unknown | NaN | One | NegativeOne | Zero | Integer | Rational | ComplexInfinity | Half" is not assignable to type "None"
+         "Expr" is not assignable to "None" (reportIncompatibleMethodOverride)
-   /tmp/mypy_primer/projects/sympy/sympy/stats/crv_types.py:2723:16 - warning: Return type, "Expr | Rational | NaN | ComplexInfinity | One | NegativeOne | Zero | Integer | Half | Infinity | NegativeInfinity | Float | _NotImplementedType | Unknown", is partially unknown (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/stats/crv_types.py:2723:16 - warning: Return type, "Expr | Unknown | NaN | One | NegativeOne | Zero | Integer | Rational | ComplexInfinity | Half", is partially unknown (reportUnknownVariableType)
-     Type of "summation" is "(f: Unknown, ...) -> (tuple[Unknown, ...] | Unknown | Self@Sum | Self@Expr | Order | Any | Zero | NaN | Piecewise | Basic | Equality | Relational | Unequality | None)" (reportUnknownVariableType)
+     Type of "summation" is "(f: Unknown, ...) -> (tuple[Unknown, ...] | Unknown | Self@Sum | Self@Expr | Order | Any | Zero | NaN | Piecewise | Basic | Equality | Relational | Unequality | Sum | None)" (reportUnknownVariableType)
-     Type of "set" is "tuple[tuple[Dummy, _NotImplementedType | Unknown | Any]]" (reportUnknownVariableType)
+     Type of "set" is "tuple[tuple[Dummy, _NotImplementedType | LessThan | Unknown | Equality | Relational | Unequality | Any]]" (reportUnknownVariableType)
-     Type of "density" is "(expr: Unknown, condition: Unknown | None = None, evaluate: bool = True, numsamples: Unknown | None = None, **kwargs: Unknown) -> Unknown" (reportUnknownVariableType)
+     Type of "density" is "(expr: Unknown, condition: Unknown | None = None, evaluate: bool = True, numsamples: Unknown | None = None, **kwargs: Unknown) -> (dict[Unknown, Unknown] | Density | Lambda | Basic | Any | Unknown | FiniteDensity | None)" (reportUnknownVariableType)

... (truncated 1537 lines) ...

mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
-   /tmp/mypy_primer/projects/mongo-python-driver/tools/convert_test_to_async.py:85:21 - warning: Unnecessary isinstance call; "(...) -> object" is never an instance of "classmethod[Unknown, ..., object]" (reportUnnecessaryIsInstance)
- 4075 errors, 51865 warnings, 0 notes
+ 4075 errors, 51864 warnings, 0 notes

kopf (https://github.com/nolar/kopf)
-   /tmp/mypy_primer/projects/kopf/kopf/_core/engines/admission.py:266:10 - warning: Unnecessary isinstance call; "WebhookServerProtocol" is never an instance of "AbstractAsyncContextManager[object, bool | None]" (reportUnnecessaryIsInstance)
-   /tmp/mypy_primer/projects/kopf/kopf/_core/engines/admission.py:267:20 - error: Object of type "Never" cannot be used with "with" because it does not implement __aenter__ (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/kopf/kopf/_core/engines/admission.py:267:20 - error: Object of type "Never" cannot be used with "with" because it does not implement __aexit__ (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/kopf/kopf/_core/engines/admission.py:267:49 - warning: Type of "server" is unknown (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/kopf/kopf/_core/engines/admission.py:268:40 - error: Object of type "object" is not callable
+     Attribute "__call__" is unknown (reportCallIssue)
- 1221 errors, 23378 warnings, 0 notes
+ 1220 errors, 23376 warnings, 0 notes

core (https://github.com/home-assistant/core)
-   /tmp/mypy_primer/projects/core/homeassistant/components/climate/__init__.py:467:16 - warning: Unnecessary isinstance call; "() -> (HVACMode | None)" is never an instance of "HVACMode" (reportUnnecessaryIsInstance)
-   /tmp/mypy_primer/projects/core/homeassistant/components/conversation/__init__.py:185:16 - warning: Unnecessary isinstance call; "() -> (str | UndefinedType | None)" is never an instance of "str" (reportUnnecessaryIsInstance)
-   /tmp/mypy_primer/projects/core/homeassistant/components/sensor/__init__.py:642:16 - warning: Unnecessary isinstance call; "() -> (StateType | date | datetime | Decimal)" is never an instance of "int | float | Decimal" (reportUnnecessaryIsInstance)
-   /tmp/mypy_primer/projects/core/homeassistant/components/sensor/__init__.py:644:20 - warning: Unnecessary isinstance call; "() -> (StateType | date | datetime | Decimal)" is never an instance of "str" (reportUnnecessaryIsInstance)
-   /tmp/mypy_primer/projects/core/homeassistant/components/sensor/__init__.py:651:45 - error: Argument of type "() -> (StateType | date | datetime | Decimal)" cannot be assigned to parameter "x" of type "ConvertibleToFloat" in function "__new__"
+   /tmp/mypy_primer/projects/core/homeassistant/components/sensor/__init__.py:651:45 - error: Argument of type "(() -> (StateType | date | datetime | Decimal)) | <subclass of Callable and str>" cannot be assigned to parameter "x" of type "ConvertibleToFloat" in function "__new__"
+     Type "(() -> (StateType | date | datetime | Decimal)) | <subclass of Callable and str>" is not assignable to type "ConvertibleToFloat"
-     Type "() -> (StateType | date | datetime | Decimal)" is not assignable to type "ConvertibleToFloat"
+       Type "() -> (StateType | date | datetime | Decimal)" is not assignable to type "ConvertibleToFloat"
-       "function" is not assignable to "str"
+         "function" is not assignable to "str"
-       "function" is incompatible with protocol "Buffer"
+         "function" is incompatible with protocol "Buffer"
-         "__buffer__" is not present
+           "__buffer__" is not present
-       "function" is incompatible with protocol "SupportsFloat"
+         "function" is incompatible with protocol "SupportsFloat"
-         "__float__" is not present
+           "__float__" is not present
-       "function" is incompatible with protocol "SupportsIndex"
+         "function" is incompatible with protocol "SupportsIndex"
-         "__index__" is not present (reportArgumentType)
+     ... (reportArgumentType)
-   /tmp/mypy_primer/projects/core/homeassistant/components/siren/__init__.py:68:13 - warning: Unnecessary isinstance call; "() -> (list[int | str] | dict[int, str] | None)" is never an instance of "dict[Unknown, Unknown]" (reportUnnecessaryIsInstance)
-   /tmp/mypy_primer/projects/core/homeassistant/components/siren/__init__.py:72:17 - warning: Conditional expression references function which always evaluates to True (reportUnnecessaryComparison)
-   /tmp/mypy_primer/projects/core/homeassistant/components/siren/__init__.py:73:16 - error: Operator "not in" not supported for types "int | str" and "() -> (list[int | str] | dict[int, str] | None)"
+   /tmp/mypy_primer/projects/core/homeassistant/components/siren/__init__.py:73:16 - error: Operator "not in" not supported for types "int | str" and "(() -> (list[int | str] | dict[int, str] | None)) | <subclass of Callable and dict>"
-   /tmp/mypy_primer/projects/core/homeassistant/components/siren/__init__.py:86:39 - error: "Never" is not iterable (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/core/homeassistant/components/technove/binary_sensor.py:135:28 - warning: Unnecessary isinstance call; "() -> (str | UndefinedType | None)" is never an instance of "str" (reportUnnecessaryIsInstance)
-   /tmp/mypy_primer/projects/core/homeassistant/components/update/__init__.py:457:50 - warning: Unnecessary isinstance call; "() -> (bool | int | None)" is never an instance of "int" (reportUnnecessaryIsInstance)
-   /tmp/mypy_primer/projects/core/homeassistant/helpers/entity.py:1018:12 - warning: Unnecessary isinstance call; "() -> StateType" is never an instance of "float" (reportUnnecessaryIsInstance)
- 26799 errors, 328522 warnings, 0 notes
+ 26798 errors, 328513 warnings, 0 notes

pip (https://github.com/pypa/pip)
-   /tmp/mypy_primer/projects/pip/src/pip/_vendor/distlib/version.py:140:16 - warning: Unnecessary isinstance call; "((v: Unknown, c: Unknown, p: Unknown) -> Unknown) | None" is never an instance of "str" (reportUnnecessaryIsInstance)
- 2408 errors, 38207 warnings, 0 notes
+ 2408 errors, 38206 warnings, 0 notes

beartype (https://github.com/beartype/beartype)
-   /tmp/mypy_primer/projects/beartype/beartype/_decor/decorcore.py:131:12 - error: Type "type* | type | CallableAny | classmethod[Unknown, ..., Unknown]* | property* | staticmethod[..., Unknown]*" is not assignable to return type "BeartypeableT@_beartype_object_fatal"
+   /tmp/mypy_primer/projects/beartype/beartype/_decor/decorcore.py:131:12 - error: Type "type* | type | ((...) -> Any) | classmethod[Unknown, ..., Unknown]* | property* | staticmethod[..., Unknown]*" is not assignable to return type "BeartypeableT@_beartype_object_fatal"
-     Type "type* | type | CallableAny | classmethod[Unknown, ..., Unknown]* | property* | staticmethod[..., Unknown]*" is not assignable to type "BeartypeableT@_beartype_object_fatal" (reportReturnType)
+     Type "type* | type | ((...) -> Any) | classmethod[Unknown, ..., Unknown]* | property* | staticmethod[..., Unknown]*" is not assignable to type "BeartypeableT@_beartype_object_fatal" (reportReturnType)
-   /tmp/mypy_primer/projects/beartype/beartype/_util/text/utiltextprefix.py:63:32 - error: Argument of type "CallableAny | classmethod[Unknown, ..., Unknown]* | property* | staticmethod[..., Unknown]*" cannot be assigned to parameter "func" of type "(...) -> Unknown" in function "label_callable"
+   /tmp/mypy_primer/projects/beartype/beartype/_util/text/utiltextprefix.py:63:32 - error: Argument of type "((...) -> Any) | classmethod[Unknown, ..., Unknown]* | property* | staticmethod[..., Unknown]*" cannot be assigned to parameter "func" of type "(...) -> Unknown" in function "label_callable"
-     Type "CallableAny | classmethod[Unknown, ..., Unknown]* | property* | staticmethod[..., Unknown]*" is not assignable to type "(...) -> Unknown"
+     Type "((...) -> Any) | classmethod[Unknown, ..., Unknown]* | property* | staticmethod[..., Unknown]*" is not assignable to type "(...) -> Unknown"

hydra-zen (https://github.com/mit-ll-responsible-ai/hydra-zen)
-   /tmp/mypy_primer/projects/hydra-zen/src/hydra_zen/wrapper/_implementations.py:271:35 - error: Argument type is partially unknown
-     Argument corresponds to parameter "obj" in function "signature"
-     Argument type is "((Any) -> Any) | Zen[..., Unknown]" (reportUnknownArgumentType)
- 1049 errors, 2051 warnings, 183 notes
+ 1048 errors, 2051 warnings, 183 notes

pytest-robotframework (https://github.com/detachhead/pytest-robotframework)
+   /tmp/mypy_primer/projects/pytest-robotframework/pytest_robotframework/__init__.py:227:65 - warning: Unnecessary "# pyright: ignore" rule: "reportUnnecessaryIsInstance" (reportUnnecessaryTypeIgnoreComment)
+   /tmp/mypy_primer/projects/pytest-robotframework/pytest_robotframework/__init__.py:228:41 - warning: Unnecessary "# pyright: ignore" rule: "reportUnreachable" (reportUnnecessaryTypeIgnoreComment)
- 335 errors, 1956 warnings, 0 notes
+ 335 errors, 1958 warnings, 0 notes

spark (https://github.com/apache/spark)
-   /tmp/mypy_primer/projects/spark/python/pyspark/pandas/generic.py:483:12 - warning: Unnecessary isinstance call; "(...) -> Any" is never an instance of "tuple[Unknown, ...]" (reportUnnecessaryIsInstance)
+   /tmp/mypy_primer/projects/spark/python/pyspark/pandas/generic.py:484:13 - warning: Type of "func" is partially unknown
+     Type of "func" is "Unknown | ((...) -> Any)" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/spark/python/pyspark/pandas/generic.py:484:13 - warning: Code is unreachable (reportUnreachable)
+   /tmp/mypy_primer/projects/spark/python/pyspark/pandas/generic.py:484:19 - warning: Type of "target" is unknown (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/spark/python/pyspark/pandas/generic.py:486:17 - warning: Code is unreachable (reportUnreachable)
+   /tmp/mypy_primer/projects/spark/python/pyspark/pandas/generic.py:486:34 - warning: Argument type is unknown
+     Argument corresponds to parameter "args" in function "__init__" (reportUnknownArgumentType)
+   /tmp/mypy_primer/projects/spark/python/pyspark/pandas/generic.py:488:20 - warning: Return type, "Any | Unknown", is partially unknown (reportUnknownVariableType)
- 33574 errors, 128186 warnings, 0 notes
+ 33574 errors, 128187 warnings, 0 notes

werkzeug (https://github.com/pallets/werkzeug)
-   /tmp/mypy_primer/projects/werkzeug/src/werkzeug/local.py:506:17 - warning: Type of "obj" is partially unknown
-     Type of "obj" is "T@LocalProxy | Unknown | None" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/werkzeug/src/werkzeug/local.py:506:23 - warning: Type of "top" is partially unknown
-     Type of "top" is "T@LocalProxy | Unknown | None" (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/werkzeug/src/werkzeug/local.py:511:24 - warning: Return type, "Any | T@LocalProxy | Unknown", is partially unknown (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/werkzeug/src/werkzeug/local.py:511:33 - warning: Argument type is partially unknown
-     Argument corresponds to parameter "o" in function "_identity"
-     Argument type is "object* | Unknown" (reportUnknownArgumentType)
- 363 errors, 2358 warnings, 0 notes
+ 363 errors, 2354 warnings, 0 notes

arviz (https://github.com/arviz-devs/arviz): 3.92x slower (8.2s -> 32.0s in a single noisy sample)

@DetachHead DetachHead merged commit 56e2825 into main Dec 1, 2024
20 checks passed
@DetachHead DetachHead deleted the fix-strictGenericNarrowing-with-Callable branch December 1, 2024 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant