Skip to content

Sync typeshed - #18803

Merged
hauntsaninja merged 6 commits into
masterfrom
mypybot/sync-typeshed
Mar 21, 2025
Merged

hauntsaninja merged 6 commits into
masterfrom
mypybot/sync-typeshed

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Sync typeshed

Source commit:
python/typeshed@cdfb10c

Note that you will need to close and re-open the PR in order to trigger CI.

@github-actions

This comment has been minimized.

@hauntsaninja

Copy link
Copy Markdown
Collaborator

A lot of diff seems to be python/typeshed#13222

@cdce8p

cdce8p commented Mar 16, 2025

Copy link
Copy Markdown
Collaborator

Opened #18806 to fix the typing issue in mypy itself uncovered here. After it is merged, this one just needs a merge / rebase.

hauntsaninja pushed a commit that referenced this pull request Mar 16, 2025
mypybot and others added 6 commits March 16, 2025 13:49
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)
@hauntsaninja
hauntsaninja force-pushed the mypybot/sync-typeshed branch from 32ad6ea to 22a0831 Compare March 16, 2025 20:49
@github-actions

Copy link
Copy Markdown
Contributor Author

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

vision (https://github.com/pytorch/vision)
- torchvision/datasets/utils.py:215: error: No overload variant of "open" matches argument types "str | Path", "str"  [call-overload]
+ torchvision/datasets/utils.py:215: error: No overload variant matches argument types "str | Path", "str"  [call-overload]
- torchvision/datasets/utils.py:215: note:     def open(name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'r:*', 'r:', 'r:gz', 'r:bz2', 'r:xz'] = ..., fileobj: IO[bytes] | 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
+ torchvision/datasets/utils.py:215: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', '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
- torchvision/datasets/utils.py:215: note:     def open(name: str | bytes | PathLike[str] | PathLike[bytes] | None, mode: Literal['x', 'x:', 'a', 'a:', 'w', 'w:', 'w:tar'], 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
+ torchvision/datasets/utils.py:215: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | None, mode: Literal['x', 'x:', 'a', 'a:', 'w', 'w:', 'w:tar'], 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
- torchvision/datasets/utils.py:215: note:     def open(name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., *, mode: Literal['x', 'x:', 'a', 'a:', 'w', 'w:', 'w:tar'], 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
+ torchvision/datasets/utils.py:215: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., *, mode: Literal['x', 'x:', 'a', 'a:', 'w', 'w:', 'w:tar'], 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
- torchvision/datasets/utils.py:215: note:     def open(name: str | bytes | PathLike[str] | PathLike[bytes] | None, mode: Literal['x:gz', 'x:bz2', 'w:gz', 'w:bz2'], 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 = ..., compresslevel: int = ...) -> TarFile
+ torchvision/datasets/utils.py:215: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | None, mode: Literal['x:gz', 'x:bz2', 'w:gz', 'w:bz2'], 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 = ..., compresslevel: int = ...) -> TarFile
- torchvision/datasets/utils.py:215: note:     def open(name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., *, mode: Literal['x:gz', 'x:bz2', 'w:gz', 'w:bz2'], 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 = ..., compresslevel: int = ...) -> TarFile
+ torchvision/datasets/utils.py:215: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., *, mode: Literal['x:gz', 'x:bz2', 'w:gz', 'w:bz2'], 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 = ..., compresslevel: int = ...) -> TarFile
- torchvision/datasets/utils.py:215: note:     def open(name: str | bytes | PathLike[str] | PathLike[bytes] | None, mode: Literal['x:xz', '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 = ..., preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ...) -> TarFile
+ torchvision/datasets/utils.py:215: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | None, mode: Literal['x:xz', '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 = ..., preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ...) -> TarFile
- torchvision/datasets/utils.py:215: note:     def open(name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., *, mode: Literal['x:xz', '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 = ..., preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ...) -> TarFile
+ torchvision/datasets/utils.py:215: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., *, mode: Literal['x:xz', '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 = ..., preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ...) -> TarFile
- torchvision/datasets/utils.py:215: note:     def open(name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., *, mode: Literal['r|*', 'r|', 'r|gz', 'r|bz2', 'r|xz'], fileobj: IO[bytes] | 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 = ..., preset: int | None = ...) -> TarFile
+ torchvision/datasets/utils.py:215: 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
- torchvision/datasets/utils.py:215: note:     def open(name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., *, mode: Literal['w|', 'w|gz', 'w|bz2', 'w|xz'], fileobj: IO[bytes] | 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 = ..., preset: int | None = ...) -> TarFile
+ torchvision/datasets/utils.py:215: 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
+ torchvision/datasets/utils.py:215: note:     def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., *, mode: Literal['w|gz', 'w|bz2'], 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 = ..., compresslevel: int = ...) -> TarFile

beartype (https://github.com/beartype/beartype)
+ beartype/_check/error/errcause.py:599: error: Incompatible types in assignment (expression has type "Callable[[ViolationCause], ViolationCause] | None", variable has type "Callable[[ViolationCause], ViolationCause]")  [assignment]
+ beartype/_check/error/errcause.py:600: error: Unused "type: ignore" comment  [unused-ignore]

prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/locking/memory.py:196: note:     def get(self, Never, /) -> None
+ src/prefect/locking/memory.py:196: note:     def get(self, Never, None = ..., /) -> None
- src/prefect/locking/memory.py:207: note:     def get(self, Never, /) -> None
+ src/prefect/locking/memory.py:207: note:     def get(self, Never, None = ..., /) -> None
+ src/prefect/server/api/concurrency_limits.py:208: error: Item "None" of "Optional[Any]" has no attribute "active_slots"  [union-attr]
+ src/prefect/server/api/concurrency_limits.py:210: error: Item "None" of "Optional[Any]" has no attribute "active_slots"  [union-attr]
+ src/prefect/server/api/concurrency_limits.py:222: error: Item "None" of "Optional[Any]" has no attribute "active_slots"  [union-attr]
+ src/prefect/server/api/concurrency_limits.py:224: error: Item "None" of "Optional[Any]" has no attribute "active_slots"  [union-attr]

httpx-caching (https://github.com/johtso/httpx-caching)
+ httpx_caching/_sync/_cache.py:20: error: Argument 1 to "loads" of "Serializer" has incompatible type "Any | None"; expected "bytes"  [arg-type]
+ httpx_caching/_async/_cache.py:20: error: Argument 1 to "loads" of "Serializer" has incompatible type "Any | None"; expected "bytes"  [arg-type]

alerta (https://github.com/alerta/alerta)
+ alerta/models/permission.py:29: error: Argument "match" to "Permission" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/permission.py:49: error: Argument "match" to "Permission" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/note.py:34: error: Argument "text" to "Note" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/note.py:35: error: Argument "user" to "Note" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/note.py:37: error: Argument "note_type" to "Note" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/note.py:76: error: Argument "text" to "Note" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/note.py:77: error: Argument "user" to "Note" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/note.py:79: error: Argument "note_type" to "Note" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/key.py:51: error: Argument "user" to "ApiKey" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/key.py:53: error: Argument "text" to "ApiKey" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/key.py:55: error: Argument "customer" to "ApiKey" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/key.py:89: error: Argument "user" to "ApiKey" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/key.py:91: error: Argument 1 to "type_to_scopes" of "ApiKeyHelper" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/key.py:91: error: Argument 2 to "type_to_scopes" of "ApiKeyHelper" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/key.py:92: error: Argument "text" to "ApiKey" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/key.py:93: error: Argument "expire_time" to "ApiKey" has incompatible type "Any | None"; expected "datetime"  [arg-type]
+ alerta/models/key.py:96: error: Argument "customer" to "ApiKey" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/heartbeat.py:85: error: Argument "origin" to "Heartbeat" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/heartbeat.py:89: error: Argument "timeout" to "Heartbeat" has incompatible type "Any | None"; expected "int"  [arg-type]
+ alerta/models/heartbeat.py:90: error: Argument "customer" to "Heartbeat" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/heartbeat.py:120: error: Argument "origin" to "Heartbeat" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/heartbeat.py:124: error: Argument "create_time" to "Heartbeat" has incompatible type "Any | None"; expected "datetime"  [arg-type]
+ alerta/models/heartbeat.py:125: error: Argument "timeout" to "Heartbeat" has incompatible type "Any | None"; expected "int"  [arg-type]
+ alerta/models/heartbeat.py:129: error: Argument "customer" to "Heartbeat" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/group.py:32: error: Argument "id" to "GroupUser" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/group.py:33: error: Argument "name" to "GroupUser" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/group.py:34: error: Argument "login" to "GroupUser" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/group.py:35: error: Argument "status" to "GroupUser" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/group.py:84: error: Argument "name" to "Group" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/group.py:85: error: Argument "text" to "Group" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/group.py:106: error: Argument "name" to "Group" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/group.py:107: error: Argument "text" to "Group" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/customer.py:23: error: Argument "match" to "Customer" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/customer.py:24: error: Argument "customer" to "Customer" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/customer.py:44: error: Argument "match" to "Customer" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/customer.py:45: error: Argument "customer" to "Customer" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/alert.py:98: error: Argument "resource" to "Alert" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/alert.py:99: error: Argument "event" to "Alert" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/alert.py:173: error: Argument "resource" to "Alert" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/alert.py:174: error: Argument "event" to "Alert" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/user.py:66: error: Argument "login" to "User" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/user.py:68: error: Argument "email" to "User" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/user.py:72: error: Argument "text" to "User" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/user.py:107: error: Argument "name" to "User" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/user.py:109: error: Argument "password" to "User" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/user.py:110: error: Argument "email" to "User" has incompatible type "Any | None"; expected "str"  [arg-type]
+ alerta/models/user.py:116: error: Argument "text" to "User" has incompatible type "Any | None"; expected "str"  [arg-type]

altair (https://github.com/vega/altair)
+ altair/utils/_vegafusion_data.py:230: error: Argument 1 to "handle_row_limit_exceeded" has incompatible type "Any | None"; expected "int"  [arg-type]
+ altair/utils/_vegafusion_data.py:281: error: Argument 1 to "handle_row_limit_exceeded" has incompatible type "Any | None"; expected "int"  [arg-type]

pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/apply.py:1664: error: Dict entry 0 has incompatible type "str": "Any | None"; expected "str": "str | bool"  [dict-item]
+ pandas/core/apply.py:1664: error: Dict entry 1 has incompatible type "str": "Any | None"; expected "str": "str | bool"  [dict-item]

pyinstrument (https://github.com/joerick/pyinstrument)
- pyinstrument/vendor/decorator.py:295: error: Incompatible types in assignment (expression has type "Callable[[Any, Any, VarArg(Any), KwArg(Any)], Any]", variable has type "Callable[[_GeneratorContextManagerBase[_G], Callable[..., _G], tuple[Any, ...], dict[str, Any]], None]")  [assignment]
+ pyinstrument/vendor/decorator.py:295: error: Incompatible types in assignment (expression has type "Callable[[Any, Any, VarArg(Any), KwArg(Any)], Any]", variable has type "Callable[[_GeneratorContextManagerBase[_G_co], Callable[..., _G_co], tuple[Any, ...], dict[str, Any]], None]")  [assignment]
- pyinstrument/vendor/decorator.py:301: error: Incompatible types in assignment (expression has type "Callable[[Any, Any, VarArg(Any), KwArg(Any)], Any]", variable has type "Callable[[_GeneratorContextManagerBase[_G], Callable[..., _G], tuple[Any, ...], dict[str, Any]], None]")  [assignment]
+ pyinstrument/vendor/decorator.py:301: error: Incompatible types in assignment (expression has type "Callable[[Any, Any, VarArg(Any), KwArg(Any)], Any]", variable has type "Callable[[_GeneratorContextManagerBase[_G_co], Callable[..., _G_co], tuple[Any, ...], dict[str, Any]], None]")  [assignment]

ignite (https://github.com/pytorch/ignite)
+ ignite/handlers/tqdm_logger.py:216: error: Argument 1 to "_OutputHandler" has incompatible type "Any | None"; expected "str"  [arg-type]

mitmproxy (https://github.com/mitmproxy/mitmproxy)
+ mitmproxy/io/compat.py:510: error: Argument 1 to "tuple" has incompatible type "Any | None"; expected "Iterable[Any]"  [arg-type]
+ mitmproxy/proxy/events.py:97: error: Invalid index type "Any | None" for "dict[Command, type[CommandCompleted]]"; expected type "Command"  [index]

kornia (https://github.com/kornia/kornia)
+ kornia/augmentation/container/augment.py:521: error: Incompatible types in assignment (expression has type "Any | None", variable has type "list[DataKey]")  [assignment]

werkzeug (https://github.com/pallets/werkzeug)
+ src/werkzeug/wsgi.py:78: error: Argument 1 to "int" has incompatible type "Optional[Any]"; expected "Union[str, Buffer, SupportsInt, SupportsIndex, SupportsTrunc]"  [arg-type]

steam.py (https://github.com/Gobot1234/steam.py)
- steam/ext/commands/utils.py:43: note:          def get(self, str, /) -> _VT | None
+ steam/ext/commands/utils.py:43: note:          def get(self, str, None = ..., /) -> _VT | None

spark (https://github.com/apache/spark)
+ python/pyspark/sql/session.py:322: error: Dict entry 0 has incompatible type "str": "Any | None"; expected "str": "str"  [dict-item]
+ python/pyspark/sql/session.py:323: error: Dict entry 1 has incompatible type "str": "Any | None"; expected "str": "str"  [dict-item]
+ python/pyspark/sql/session.py:589: error: Item "None" of "Any | None" has no attribute "startswith"  [union-attr]

streamlit (https://github.com/streamlit/streamlit)
+ lib/streamlit/runtime/state/session_state.py: note: In member "get_id_from_key" of class "KeyIdMapper":
+ lib/streamlit/runtime/state/session_state.py:313:9: error: Returning Any from function declared to return "str"  [no-any-return]

porcupine (https://github.com/Akuli/porcupine)
+ porcupine/plugins/highlight/tree_sitter_highlighter.py:84: error: Incompatible return value type (got "Any | None", expected "str")  [return-value]

freqtrade (https://github.com/freqtrade/freqtrade)
+ freqtrade/exchange/binance.py:75: error: Incompatible return value type (got "Any | None", expected "str")  [return-value]
+ freqtrade/data/entryexitanalysis.py:334: error: Argument 1 to "Path" has incompatible type "Any | None"; expected "str | PathLike[str]"  [arg-type]

sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/domains/python/_object.py: note: In member "add_target_and_index" of class "PyObject":
+ sphinx/domains/python/_object.py:432:50: error: Argument 1 to "get_index_text" of "PyObject" has incompatible type "Any | None"; expected "str"  [arg-type]
+ sphinx/domains/javascript.py: note: In member "handle_signature" of class "JSObject":
+ sphinx/domains/javascript.py:143:16: error: Incompatible return value type (got "tuple[str, Any | None]", expected "tuple[str, str]")  [return-value]

django-stubs (https://github.com/typeddjango/django-stubs)
+ django-stubs/utils/datastructures.pyi:65: error: Signature of "get" incompatible with supertype "dict"  [override]
+ django-stubs/utils/datastructures.pyi:65: note:      Superclass:
+ django-stubs/utils/datastructures.pyi:65: note:          @overload
+ django-stubs/utils/datastructures.pyi:65: note:          def get(self, _K, None = ..., /) -> Optional[_V]
+ django-stubs/utils/datastructures.pyi:65: note:          @overload
+ django-stubs/utils/datastructures.pyi:65: note:          def get(self, _K, _V, /) -> _V
+ django-stubs/utils/datastructures.pyi:65: note:          @overload
+ django-stubs/utils/datastructures.pyi:65: note:          def [_T] get(self, _K, _T, /) -> Union[_V, _T]
+ django-stubs/utils/datastructures.pyi:65: note:      Subclass:
+ django-stubs/utils/datastructures.pyi:65: note:          @overload
+ django-stubs/utils/datastructures.pyi:65: note:          def get(self, key: _K) -> Optional[_V]
+ django-stubs/utils/datastructures.pyi:65: note:          @overload
+ django-stubs/utils/datastructures.pyi:65: note:          def [_Z] get(self, key: _K, default: _Z) -> Union[_V, _Z]

pylint (https://github.com/pycqa/pylint)
+ pylint/config/utils.py:66: error: Argument "metavar" to "_CallableArgument" has incompatible type "Any | None"; expected "str"  [arg-type]

operator (https://github.com/canonical/operator)
- ops/_private/harness.py:1200: error: Argument 2 to "get" of "dict" has incompatible type "None"; expected "Mapping[str, str]"  [arg-type]
+ ops/_private/harness.py:1200: error: Incompatible return value type (got "dict[str, str] | None", expected "Mapping[str, str]")  [return-value]

ibis (https://github.com/ibis-project/ibis)
- ibis/common/collections.py:280: error: Definition of "get" in base class "dict" is incompatible with definition in base class "Mapping"  [misc]
- ibis/backends/polars/compiler.py:745: note:     def register(self, cls: type[Any], func: None = ...) -> Callable[[Callable[..., Any]], Callable[..., Any]]
+ ibis/backends/polars/compiler.py:745: note:     def register(self, cls: type[Any] | UnionType, func: None = ...) -> Callable[[Callable[..., Any]], Callable[..., Any]]
- ibis/backends/polars/compiler.py:745: note:     def register(self, cls: type[Any], func: Callable[..., Any]) -> Callable[..., Any]
+ ibis/backends/polars/compiler.py:745: note:     def register(self, cls: type[Any] | UnionType, func: Callable[..., Any]) -> Callable[..., Any]

core (https://github.com/home-assistant/core)
+ homeassistant/components/alexa/capabilities.py:1441: error: Unsupported right operand type for in ("Any | None")  [operator]
+ homeassistant/components/tradfri/config_flow.py:60: error: Argument 2 to "authenticate" has incompatible type "Any | None"; expected "str"  [arg-type]
+ homeassistant/components/fints/sensor.py:86: error: Argument 2 to "FinTsClient" has incompatible type "Any | None"; expected "str"  [arg-type]
+ homeassistant/components/everlights/light.py:123: error: Value of type "Any | None" is not indexable  [index]
+ homeassistant/components/everlights/light.py:123: error: Unsupported operand types for / ("None" and "int")  [operator]
+ homeassistant/components/everlights/light.py:123: note: Left operand is of type "Any | None"
+ homeassistant/components/melcloud/climate.py:239: error: Argument 1 to "_apply_set_hvac_mode" of "AtaDeviceClimate" has incompatible type "Any | None"; expected "HVACMode"  [arg-type]
+ homeassistant/components/home_connect/light.py:214: error: Argument 2 to "brightness_to_value" has incompatible type "Any | None"; expected "int"  [arg-type]
+ homeassistant/components/home_connect/light.py:220: error: Value of type "Any | None" is not indexable  [index]

openlibrary (https://github.com/internetarchive/openlibrary)
+ openlibrary/solr/updater/edition.py: note: In member "lexile" of class "EditionSolrBuilder":
+ openlibrary/solr/updater/edition.py:150: error: Argument 1 to "int" has incompatible type "Any | None"; expected "str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc"  [arg-type]
+ openlibrary/solr/updater/edition.py: note: In member "number_of_pages" of class "EditionSolrBuilder":
+ openlibrary/solr/updater/edition.py:174: error: Argument 1 to "int" has incompatible type "Any | None"; expected "str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc"  [arg-type]

dd-trace-py (https://github.com/DataDog/dd-trace-py)
+ ddtrace/appsec/_iast/taint_sinks/path_traversal.py:30: error: Argument "evidence_value" to "report" of "VulnerabilityBase" has incompatible type "Any | None"; expected "str"  [arg-type]

cloud-init (https://github.com/canonical/cloud-init)
+ cloudinit/config/cc_ca_certs.py:256: error: Unsupported right operand type for in ("Any | None")  [operator]
+ cloudinit/config/cc_ca_certs.py:262: error: Item "None" of "Any | None" has no attribute "get"  [union-attr]
+ cloudinit/config/cc_ca_certs.py:263: error: Item "None" of "Any | None" has no attribute "get"  [union-attr]
+ cloudinit/config/cc_ca_certs.py:269: error: Unsupported right operand type for in ("Any | None")  [operator]

@hauntsaninja
hauntsaninja merged commit e5546fe into master Mar 21, 2025
@hauntsaninja
hauntsaninja deleted the mypybot/sync-typeshed branch March 21, 2025 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants