-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Sync typeshed #19440
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
Closed
Closed
Sync typeshed #19440
Conversation
This file contains hidden or 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@84e41f2
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.
Diff from mypy_primer, showing the effect of this PR on open source code: pandas (https://github.com/pandas-dev/pandas)
- pandas/io/common.py:995: note: def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None, mode: Literal['r|*', 'r|', 'r|gz', 'r|bz2', 'r|xz'], fileobj: _Fileobj | None = ..., bufsize: int = ..., *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note: def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None, mode: Literal['r|*', 'r|', 'r|gz', 'r|bz2', 'r|xz', 'r|zst'], fileobj: _Fileobj | None = ..., bufsize: int = ..., *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: int | None = ..., errorlevel: int | None = ...) -> TarFile
- pandas/io/common.py:995: note: def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., *, mode: Literal['r|*', 'r|', 'r|gz', 'r|bz2', 'r|xz'], fileobj: _Fileobj | None = ..., bufsize: int = ..., format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note: def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., *, mode: Literal['r|*', 'r|', 'r|gz', 'r|bz2', 'r|xz', 'r|zst'], fileobj: _Fileobj | None = ..., bufsize: int = ..., format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: int | None = ..., errorlevel: int | None = ...) -> TarFile
- pandas/io/common.py:995: note: def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None, mode: Literal['w|', 'w|xz'], fileobj: _Fileobj | None = ..., bufsize: int = ..., *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note: def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None, mode: Literal['w|', 'w|xz', 'w|zst'], fileobj: _Fileobj | None = ..., bufsize: int = ..., *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: int | None = ..., errorlevel: int | None = ...) -> TarFile
- pandas/io/common.py:995: note: def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., *, mode: Literal['w|', 'w|xz'], fileobj: _Fileobj | None = ..., bufsize: int = ..., format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note: def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., *, mode: Literal['w|', 'w|xz', 'w|zst'], fileobj: _Fileobj | None = ..., bufsize: int = ..., format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: int | None = ..., errorlevel: int | None = ...) -> TarFile
steam.py (https://github.com/Gobot1234/steam.py)
+ steam/ext/commands/utils.py:43: note: def get(self, str, /, default: _VT) -> _VT
+ steam/ext/commands/utils.py:43: note: @overload
- steam/ext/commands/utils.py:43: note: def [_T] get(self, str, /, default: _VT | _T) -> _VT | _T
+ steam/ext/commands/utils.py:43: note: def [_T] get(self, str, /, default: _T) -> _VT | _T
django-stubs (https://github.com/typeddjango/django-stubs)
+ django-stubs/utils/datastructures.pyi:65: error: Unused "type: ignore" comment [unused-ignore]
spack (https://github.com/spack/spack)
+ lib/spack/spack/cmd/style.py:666: error: Incompatible types in assignment (expression has type "str | bytes | int | float | complex | EllipsisType | None", variable has type "str") [assignment]
pyodide (https://github.com/pyodide/pyodide)
+ pyodide-build/pyodide_build/xbuildenv_releases.py:220: note: def get(self, str, /, default: str) -> str
- pyodide-build/pyodide_build/xbuildenv_releases.py:220: note: def [_T] get(self, str, /, default: str | _T) -> str | _T
+ pyodide-build/pyodide_build/xbuildenv_releases.py:220: note: def [_T] get(self, str, /, default: _T) -> str | _T
ignite (https://github.com/pytorch/ignite)
+ ignite/handlers/visdom_logger.py:182: error: Redundant cast to "str" [redundant-cast]
operator (https://github.com/canonical/operator)
+ ops/model.py:1025: note: def get(self, str, /, default: Binding) -> Binding
+ ops/model.py:1025: note: @overload
- ops/model.py:1025: note: def [_T] get(self, str, /, default: Binding | _T) -> Binding | _T
+ ops/model.py:1025: note: def [_T] get(self, str, /, default: _T) -> Binding | _T
starlette (https://github.com/encode/starlette)
+ starlette/requests.py:137: error: Returning Any from function declared to return "dict[str, Any]" [no-any-return]
discord.py (https://github.com/Rapptz/discord.py)
- ...venv/lib/python3.13/site-packages/mypy/typeshed/stdlib/typing.pyi:1014: note: "update" of "TypedDict" defined here
+ ...venv/lib/python3.13/site-packages/mypy/typeshed/stdlib/typing.pyi:1015: note: "update" of "TypedDict" defined here
core (https://github.com/home-assistant/core)
+ homeassistant/components/transmission/coordinator.py:63: error: Returning Any from function declared to return "int" [no-any-return]
+ homeassistant/components/transmission/coordinator.py:68: error: Returning Any from function declared to return "str" [no-any-return]
+ homeassistant/components/islamic_prayer_times/coordinator.py:57: error: Returning Any from function declared to return "str" [no-any-return]
+ homeassistant/components/islamic_prayer_times/coordinator.py:71: error: Returning Any from function declared to return "str" [no-any-return]
+ homeassistant/components/islamic_prayer_times/coordinator.py:76: error: Returning Any from function declared to return "str" [no-any-return]
+ homeassistant/components/bthome/coordinator.py:48: error: Returning Any from function declared to return "bool" [no-any-return]
+ homeassistant/components/androidtv_remote/helpers.py:30: error: Returning Any from function declared to return "bool" [no-any-return]
+ homeassistant/components/xiaomi_ble/coordinator.py:70: error: Returning Any from function declared to return "bool" [no-any-return]
+ homeassistant/components/unifiprotect/data.py:96: error: Returning Any from function declared to return "bool" [no-any-return]
+ homeassistant/components/unifiprotect/data.py:101: error: Returning Any from function declared to return "int" [no-any-return]
+ homeassistant/components/shelly/utils.py:454: error: Returning Any from function declared to return "int" [no-any-return]
+ homeassistant/components/mikrotik/coordinator.py:86: error: Returning Any from function declared to return "bool" [no-any-return]
+ homeassistant/components/mikrotik/coordinator.py:91: error: Returning Any from function declared to return "bool" [no-any-return]
+ homeassistant/components/bthome/device_trigger.py:73: error: Returning Any from function declared to return "list[str]" [no-any-return]
+ homeassistant/components/squeezebox/media_player.py:290: error: Returning Any from function declared to return "int" [no-any-return]
+ homeassistant/components/shelly/coordinator.py:166: error: Returning Any from function declared to return "int" [no-any-return]
|
Created #19446 with a fix for the pythoneval test since I can't push to this branch directly unfortunately. |
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@84e41f2
Note that you will need to close and re-open the PR in order to trigger CI.