-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Mypybot/sync typeshed #17280
Merged
Merged
Mypybot/sync typeshed #17280
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
Source commit: python/typeshed@ac6c61b
This is allegedly causing large performance problems, see 13821 typeshed/8231 had zero hits on mypy_primer, so it's not the worst thing to undo. Patching this in typeshed also feels weird, since there's a more general soundness issue. If a typevar has a bound or constraint, we might not want to solve it to a Literal. If we can confirm the performance regression or fix the unsoundness within mypy, I might pursue upstreaming this in typeshed. (Reminder: add this to the sync_typeshed script once merged)
… checking: #13987 (comment) A manual cherry-pick of e437cdf.
This comment has been minimized.
This comment has been minimized.
There's some new errors in mypy itself, I can look into fixing those over the next few days. |
Should I even merge this if it's going to cause errors in mypy checking mypy? |
No, the type checking issues need to be addressed first. I'll take a look now. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
AlexWaygood
reviewed
May 24, 2024
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Diff from mypy_primer, showing the effect of this PR on open source code: pyp (https://github.com/hauntsaninja/pyp)
+ pyp.py:585: error: "AST" has no attribute "lineno" [attr-defined]
+ pyp.py:586: error: "AST" has no attribute "end_lineno" [attr-defined]
mypy (https://github.com/python/mypy)
+ mypy/pyinfo.py:74: error: Unused "type: ignore" comment [unused-ignore]
+ mypy/pyinfo.py:74: error: Item "TextIO" of "Union[TextIO, Any]" has no attribute "reconfigure" [union-attr]
+ mypy/pyinfo.py:74: note: Error code "union-attr" not covered by "type: ignore" comment
+ mypy/pyinfo.py:74: note: See https://mypy.rtfd.io/en/stable/_refs.html#code-union-attr for more info
+ mypy/fastparse.py:2048: error: "Index" has no attribute "col_offset" [attr-defined]
+ mypy/fastparse.py:2051: error: "Slice" has no attribute "col_offset" [attr-defined]
+ mypy/fastparse.py:2052: error: Argument 1 to "Tuple" has incompatible type "List[slice]"; expected "List[expr]" [arg-type]
pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/capture.py:204: error: Item "None" of "TextIOWrapper | None" has no attribute "encoding" [union-attr]
+ src/_pytest/faulthandler.py:65: error: Item "None" of "TextIOWrapper | None" has no attribute "fileno" [union-attr]
tornado (https://github.com/tornadoweb/tornado)
+ tornado/test/runtests.py:174: error: Unused "type: ignore" comment [unused-ignore]
rich (https://github.com/Textualize/rich)
+ rich/console.py:93: error: Item "None" of "TextIOWrapper | None" has no attribute "fileno" [union-attr]
+ rich/console.py:97: error: Item "None" of "TextIOWrapper | None" has no attribute "fileno" [union-attr]
+ rich/console.py:101: error: Item "None" of "TextIOWrapper | None" has no attribute "fileno" [union-attr]
- rich/live.py:180: error: Subclass of "TextIO" and "FileProxy" cannot exist: would have incompatible method signatures [unreachable]
- rich/live.py:183: error: Subclass of "TextIO" and "FileProxy" cannot exist: would have incompatible method signatures [unreachable]
cwltool (https://github.com/common-workflow-language/cwltool)
+ tests/test_context.py:17: error: Unused "type: ignore" comment [unused-ignore]
+ tests/test_context.py:18: error: Unused "type: ignore" comment [unused-ignore]
werkzeug (https://github.com/pallets/werkzeug)
+ src/werkzeug/routing/rules.py:785: error: Argument 1 to "JoinedStr" has incompatible type "list[AST]"; expected "list[expr]" [arg-type]
+ src/werkzeug/routing/rules.py:788: error: List item 0 has incompatible type "AST"; expected "expr" [list-item]
+ src/werkzeug/routing/rules.py:788: error: List item 1 has incompatible type "AST"; expected "expr" [list-item]
+ src/werkzeug/routing/rules.py:818: error: "AST" has no attribute "lineno" [attr-defined]
+ src/werkzeug/routing/rules.py:820: error: "AST" has no attribute "end_lineno" [attr-defined]
+ src/werkzeug/routing/rules.py:820: error: "AST" has no attribute "lineno" [attr-defined]
+ src/werkzeug/routing/rules.py:822: error: "AST" has no attribute "col_offset" [attr-defined]
+ src/werkzeug/routing/rules.py:824: error: "AST" has no attribute "end_col_offset" [attr-defined]
+ src/werkzeug/routing/rules.py:824: error: "AST" has no attribute "col_offset" [attr-defined]
- tests/test_debug.py:196: error: Incompatible types in assignment (expression has type "HTMLStringO", variable has type "TextIO") [assignment]
- tests/test_debug.py:199: error: "TextIO" has no attribute "reset" [attr-defined]
- tests/test_debug.py:201: error: "TextIO" has no attribute "reset" [attr-defined]
- tests/test_debug.py:213: error: Incompatible types in assignment (expression has type "HTMLStringO", variable has type "TextIO") [assignment]
- tests/test_debug.py:216: error: "TextIO" has no attribute "reset" [attr-defined]
scrapy (https://github.com/scrapy/scrapy)
+ scrapy/utils/log.py:127: error: Unused "type: ignore" comment [unused-ignore]
streamlit (https://github.com/streamlit/streamlit)
- lib/tests/streamlit/web/bootstrap_test.py:107:15: error: "TextIO" has no attribute "getvalue" [attr-defined]
+ lib/tests/streamlit/web/bootstrap_test.py:107:15: error: Item "TextIO" of "Union[TextIO, Any]" has no attribute "getvalue" [union-attr]
- lib/tests/streamlit/web/bootstrap_test.py:131:15: error: "TextIO" has no attribute "getvalue" [attr-defined]
+ lib/tests/streamlit/web/bootstrap_test.py:131:15: error: Item "TextIO" of "Union[TextIO, Any]" has no attribute "getvalue" [union-attr]
- lib/tests/streamlit/web/bootstrap_test.py:153:15: error: "TextIO" has no attribute "getvalue" [attr-defined]
+ lib/tests/streamlit/web/bootstrap_test.py:153:15: error: Item "TextIO" of "Union[TextIO, Any]" has no attribute "getvalue" [union-attr]
- lib/tests/streamlit/web/bootstrap_test.py:178:15: error: "TextIO" has no attribute "getvalue" [attr-defined]
+ lib/tests/streamlit/web/bootstrap_test.py:178:15: error: Item "TextIO" of "Union[TextIO, Any]" has no attribute "getvalue" [union-attr]
- lib/tests/streamlit/web/bootstrap_test.py:203:15: error: "TextIO" has no attribute "getvalue" [attr-defined]
+ lib/tests/streamlit/web/bootstrap_test.py:203:15: error: Item "TextIO" of "Union[TextIO, Any]" has no attribute "getvalue" [union-attr]
- lib/tests/streamlit/web/bootstrap_test.py:224:15: error: "TextIO" has no attribute "getvalue" [attr-defined]
+ lib/tests/streamlit/web/bootstrap_test.py:224:15: error: Item "TextIO" of "Union[TextIO, Any]" has no attribute "getvalue" [union-attr]
- lib/tests/streamlit/web/bootstrap_test.py:248:15: error: "TextIO" has no attribute "getvalue" [attr-defined]
+ lib/tests/streamlit/web/bootstrap_test.py:248:15: error: Item "TextIO" of "Union[TextIO, Any]" has no attribute "getvalue" [union-attr]
- lib/tests/streamlit/web/bootstrap_test.py:273:15: error: "TextIO" has no attribute "getvalue" [attr-defined]
+ lib/tests/streamlit/web/bootstrap_test.py:273:15: error: Item "TextIO" of "Union[TextIO, Any]" has no attribute "getvalue" [union-attr]
- lib/tests/streamlit/web/bootstrap_test.py:298:15: error: "TextIO" has no attribute "getvalue" [attr-defined]
+ lib/tests/streamlit/web/bootstrap_test.py:298:15: error: Item "TextIO" of "Union[TextIO, Any]" has no attribute "getvalue" [union-attr]
- lib/tests/streamlit/web/bootstrap_test.py:315:15: error: "TextIO" has no attribute "getvalue" [attr-defined]
+ lib/tests/streamlit/web/bootstrap_test.py:315:15: error: Item "TextIO" of "Union[TextIO, Any]" has no attribute "getvalue" [union-attr]
- lib/tests/streamlit/web/bootstrap_test.py:336:15: error: "TextIO" has no attribute "getvalue" [attr-defined]
+ lib/tests/streamlit/web/bootstrap_test.py:336:15: error: Item "TextIO" of "Union[TextIO, Any]" has no attribute "getvalue" [union-attr]
- lib/tests/streamlit/web/bootstrap_test.py:345:15: error: "TextIO" has no attribute "getvalue" [attr-defined]
+ lib/tests/streamlit/web/bootstrap_test.py:345:15: error: Item "TextIO" of "Union[TextIO, Any]" has no attribute "getvalue" [union-attr]
ibis (https://github.com/ibis-project/ibis)
+ ibis/backends/bigquery/udf/core.py:69: error: Missing positional arguments "args", "keywords" in call to "Call" [call-arg]
+ ibis/backends/bigquery/udf/core.py:82: error: Missing positional arguments "args", "keywords" in call to "Call" [call-arg]
+ ibis/backends/bigquery/udf/core.py:88: error: Missing positional arguments "args", "keywords" in call to "Call" [call-arg]
+ ibis/backends/bigquery/udf/core.py:88: error: Missing positional argument "value" in call to "Attribute" [call-arg]
+ ibis/backends/bigquery/udf/core.py:98: error: Missing positional arguments "args", "keywords" in call to "Call" [call-arg]
|
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.
Sync typeshed before 1.11 release.