-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Sync typeshed #18082
Merged
Merged
Sync typeshed #18082
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@d262beb
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.
Note: this sync includes python/typeshed#12910, which has mypy_primer hits for mypy: mypy (https://github.com/python/mypy)
+ mypy/modulefinder.py:780: error: Argument 1 to "strerror" has incompatible type "Optional[int]"; expected "int" [arg-type]
+ mypy/build.py:2147: error: Argument 1 to "strerror" has incompatible type "Optional[int]"; expected "int" [arg-type] |
This comment has been minimized.
This comment has been minimized.
Diff from mypy_primer, showing the effect of this PR on open source code: manticore (https://github.com/trailofbits/manticore)
+ manticore/platforms/linux.py:1767: error: Unsupported operand type for unary - ("int | None") [operator]
+ manticore/platforms/linux.py:1780: error: Unsupported operand type for unary - ("int | None") [operator]
+ manticore/platforms/linux.py:1810: error: Unsupported operand type for unary - ("int | None") [operator]
+ manticore/platforms/linux.py:2340: error: Unsupported operand type for unary - ("int | None") [operator]
+ manticore/platforms/linux.py:3512: error: Unsupported operand type for unary - ("int | None") [operator]
+ manticore/platforms/linux.py:3525: error: Unsupported operand type for unary - ("int | None") [operator]
+ manticore/platforms/linux.py:3560: error: Unsupported operand type for unary - ("int | None") [operator]
+ manticore/platforms/linux.py:3578: error: Unsupported operand type for unary - ("int | None") [operator]
+ manticore/platforms/linux.py:3590: error: Unsupported operand type for unary - ("int | None") [operator]
+ manticore/platforms/linux.py:3668: error: Unsupported operand type for unary - ("int | None") [operator]
+ manticore/platforms/linux.py:3681: error: Unsupported operand type for unary - ("int | None") [operator]
bokeh (https://github.com/bokeh/bokeh)
+ src/bokeh/command/util.py: note: In function "report_server_init_errors":
+ src/bokeh/command/util.py:217:40: error: Invalid index type "int | None" for "Mapping[int, str]"; expected type "int" [index]
beartype (https://github.com/beartype/beartype)
+ beartype/claw/_importlib/_clawimpload.py:28: error: Unused "type: ignore" comment [unused-ignore]
pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/_py/error.py:101: error: Argument 1 to "_geterrnoclass" of "ErrorMaker" has incompatible type "Optional[int]"; expected "int" [arg-type]
+ src/_pytest/pathlib.py:704: error: Argument 2 to "_NamespaceLoader" has incompatible type "Path"; expected "MutableSequence[str]" [arg-type]
+ src/_pytest/pathlib.py:704: error: Argument 3 to "_NamespaceLoader" has incompatible type "PathFinder"; expected "Callable[[str, Tuple[str, ...]], ModuleSpec]" [arg-type]
aiohttp (https://github.com/aio-libs/aiohttp)
+ aiohttp/connector.py:1085: error: Unused "type: ignore" comment [unused-ignore]
+ aiohttp/connector.py:1174: error: Unused "type: ignore" comment [unused-ignore]
+ aiohttp/connector.py:1245: error: Unused "type: ignore" comment [unused-ignore]
+ aiohttp/connector.py:1440: error: Unused "type: ignore" comment [unused-ignore]
+ aiohttp/connector.py:1509: error: Unused "type: ignore" comment [unused-ignore]
+ aiohttp/client_reqrep.py:594: error: Unused "type: ignore" comment [unused-ignore]
+ aiohttp/client.py:683: error: Unused "type: ignore" comment [unused-ignore]
mkosi (https://github.com/systemd/mkosi)
+ mkosi/sandbox.py:324:22: error: Argument 1 to "_exit" has incompatible type "Optional[int]"; expected "int" [arg-type]
cloud-init (https://github.com/canonical/cloud-init)
+ cloudinit/url_helper.py:84: error: Incompatible return value type (got "int | None", expected "int") [return-value]
|
Primer hits are from
aiohttp is also from the |
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
Source commit:
python/typeshed@d262beb
Note that you will need to close and re-open the PR in order to trigger CI.