forked from python/mypy
-
Notifications
You must be signed in to change notification settings - Fork 4
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
intersections become never #530
Draft
KotlinIsland
wants to merge
1
commit into
master
Choose a base branch
from
feat/intersection-never
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment has been minimized.
This comment has been minimized.
KotlinIsland
force-pushed
the
feat/intersection-never
branch
from
October 10, 2023 07:12
5beceb5
to
a478ca1
Compare
This comment has been minimized.
This comment has been minimized.
KotlinIsland
force-pushed
the
master
branch
3 times, most recently
from
October 16, 2023 01:42
00d22ec
to
bc4ea04
Compare
KotlinIsland
force-pushed
the
master
branch
5 times, most recently
from
October 31, 2023 05:17
7d90d82
to
feefbbd
Compare
KotlinIsland
force-pushed
the
feat/intersection-never
branch
from
November 15, 2023 22:49
a478ca1
to
324e7ac
Compare
Diff from mypy_primer, showing the effect of this PR on open source code: jax (https://github.com/google/jax)
- jax/_src/array.py:768:19: error: Intersection of "slice & int" cannot exist: would have incompatible method signatures [unreachable]
+ jax/_src/api.py:856:16: error: "Never" not callable [misc]
- jax/_src/api.py:856:16: error: Expression has type "Untyped" [no-any-expr]
- jax/_src/api.py:856:16: error: Expression has type "Any (from omitted generics)" [no-any-expr]
- jax/_src/api.py:856:51: error: Call to incomplete function "_std_basis" in typed context [no-untyped-call]
- jax/_src/api.py:856:51: error: "_std_basis" does not return a value [func-returns-value]
- jax/_src/api.py:856:51: note: Type is "def (pytree: Untyped) -> None"
- jax/_src/api.py:856:62: error: Cannot determine type of "dyn_args" [has-type]
- jax/_src/api.py:860:64: error: Expression has type "Any (from omitted generics)" [no-any-expr]
+ jax/_src/api.py:864:7: error: Statement is unreachable [unreachable]
- jax/_src/api.py:862:65: error: Expression has type "Any (from omitted generics)" [no-any-expr]
- jax/_src/api.py:862:68: error: Expression has type "Any (from omitted generics)" [no-any-expr]
- jax/_src/api.py:864:7: error: Returning Any from function declared to return "None" [no-any-return]
- jax/_src/api.py:864:14: error: Expression has type "Any" [no-any-expr]
scikit-learn (https://github.com/scikit-learn/scikit-learn)
- sklearn/model_selection/_search.py:760:39: error: Intersection of "bool & str" cannot exist: would have incompatible method signatures [unreachable]
sympy (https://github.com/sympy/sympy)
- sympy/matrices/reductions.py:166:16: error: Expression type contains "Any" (has type "bool & FunctionType | (expr: Untyped) -> None") [no-any-expr]
+ sympy/matrices/reductions.py:166:16: error: Expression type contains "Any" (has type "(expr: Untyped) -> None") [no-any-expr]
+ sympy/matrices/reductions.py:166:28: error: If condition is always false [redundant-expr]
- sympy/matrices/reductions.py:168:49: error: Expression type contains "Any" (has type "bool & FunctionType | (expr: Untyped) -> None") [no-any-expr]
+ sympy/matrices/reductions.py:168:49: error: Expression type contains "Any" (has type "(expr: Untyped) -> None") [no-any-expr]
- sympy/matrices/reductions.py:214:16: error: Expression type contains "Any" (has type "bool & FunctionType | (expr: Untyped) -> None") [no-any-expr]
+ sympy/matrices/reductions.py:214:16: error: Expression type contains "Any" (has type "(expr: Untyped) -> None") [no-any-expr]
+ sympy/matrices/reductions.py:214:28: error: If condition is always false [redundant-expr]
- sympy/matrices/reductions.py:242:49: error: Expression type contains "Any" (has type "bool & FunctionType | (expr: Untyped) -> None") [no-any-expr]
+ sympy/matrices/reductions.py:242:49: error: Expression type contains "Any" (has type "(expr: Untyped) -> None") [no-any-expr]
- sympy/matrices/reductions.py:379:24: error: Incompatible types in assignment (expression has type "(expr: Untyped) -> None", variable has type "bool & FunctionType") [assignment]
+ sympy/matrices/reductions.py:377:13: error: Statement is unreachable [unreachable]
+ sympy/matrices/reductions.py:379:24: error: Expression type contains "Any" (has type "(expr: Untyped) -> None") [no-any-expr]
+ sympy/matrices/reductions.py:381:57: error: Expression type contains "Any" (has type "(expr: Untyped) -> None") [no-any-expr]
+ sympy/matrices/eigen.py:206:13: error: Statement is unreachable [unreachable]
- sympy/matrices/eigen.py:206:13: error: Usage of untyped name "charpoly" in typed context [no-untyped-usage]
- sympy/matrices/eigen.py:206:24: error: Expression has type "Untyped" [no-any-expr]
+ sympy/matrices/eigen.py:247:13: error: Statement is unreachable [unreachable]
- sympy/matrices/eigen.py:247:13: error: Usage of untyped name "charpoly" in typed context [no-untyped-usage]
- sympy/matrices/eigen.py:247:24: error: Expression has type "Untyped" [no-any-expr]
manticore (https://github.com/trailofbits/manticore)
- manticore/platforms/evm.py:3340:41: error: Incompatible types in assignment (expression has type "(Any, Any, Any, Any, Any, Any, Any, bool & None)", variable has type "None") [assignment]
+ manticore/platforms/evm.py:3340:41: error: Incompatible types in assignment (expression has type "(Any, Any, Any, Any, Any, Any, Any, Never)", variable has type "None") [assignment]
- manticore/platforms/evm.py:3376:9: error: No return value expected [return-value]
+ manticore/platforms/evm.py:3376:9: error: Returning Any from function declared to return "None" [no-any-return]
sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/util/typing.py:215:39: error: "Never" has no attribute "__forward_arg__" [attr-defined]
schema_salad (https://github.com/common-workflow-language/schema_salad)
+ schema_salad/schema.py:532:16: error: Need type annotation for "avro" [var-annotated]
+ schema_salad/schema.py:532:16: note: See https://kotlinisland.github.io/basedmypy/_refs.html#code-var-annotated for more info
- schema_salad/tests/test_cg.py:89:1: note: See https://kotlinisland.github.io/basedmypy/_refs.html#code-var-annotated for more info
yarl (https://github.com/aio-libs/yarl)
- tests/test_url.py: note: In function "test_url_is_not_str":
- tests/test_url.py:48:27: error: Intersection of "URL & str" cannot exist: would have incompatible method signatures [unreachable]
- tests/test_url.py:48:27: note: See https://kotlinisland.github.io/basedmypy/_refs.html#code-unreachable for more info
+ yarl/_url.py:386:9: note: See https://kotlinisland.github.io/basedmypy/_refs.html#code-unreachable for more info
spark (https://github.com/apache/spark)
- python/pyspark/pandas/generic.py:786:25: error: Intersection of "bool & list[Any]" cannot exist: would have incompatible method signatures [unreachable]
dulwich (https://github.com/dulwich/dulwich)
- dulwich/repo.py:1034:36: error: Intersection of "bool & str" cannot exist: would have incompatible method signatures [unreachable]
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TypeAlias
annotation #518Never
#432@final
types should result inNever
#451