Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Dec 1, 2024

Sync typeshed

Source commit:
python/typeshed@0a2da01

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

mypybot and others added 4 commits December 1, 2024 00:07
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)
@github-actions
Copy link
Contributor Author

github-actions bot commented Dec 1, 2024

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

pydantic (https://github.com/pydantic/pydantic)
+ pydantic/v1/typing.py:41: error: Unused "type: ignore" comment  [unused-ignore]
- pydantic/_internal/_typing_extra.py:412: error: Module has no attribute "_Final"; maybe "Final"?  [attr-defined]

black (https://github.com/psf/black)
+ src/blib2to3/pgen2/pgen.py:360:32: error: Argument 2 to "SyntaxError" has incompatible type "tuple[Union[str, PathLike[str]], int, int, str]"; expected "tuple[Optional[str], Optional[int], Optional[int], Optional[str]]"  [arg-type]

comtypes (https://github.com/enthought/comtypes)
- comtypes/typeinfo.py:1112: error: List item 0 has incompatible type "tuple[str, Module]"; expected "tuple[str, type[_CData]] | tuple[str, type[_CData], int]"  [list-item]
- comtypes/typeinfo.py:1149: error: List item 0 has incompatible type "tuple[str, Module]"; expected "tuple[str, type[_CData]] | tuple[str, type[_CData], int]"  [list-item]
+ comtypes/typeinfo.py:1112: error: List item 0 has incompatible type "tuple[str, Module]"; expected "tuple[str, type[_SimpleCData[Any]] | type[_Pointer[Any]] | type[CFuncPtr] | type[_ctypes.Union] | type[Structure] | type[Array[Any]]] | tuple[str, type[_SimpleCData[Any]] | type[_Pointer[Any]] | type[CFuncPtr] | type[_ctypes.Union] | type[Structure] | type[Array[Any]], int]"  [list-item]
+ comtypes/typeinfo.py:1149: error: List item 0 has incompatible type "tuple[str, Module]"; expected "tuple[str, type[_SimpleCData[Any]] | type[_Pointer[Any]] | type[CFuncPtr] | type[_ctypes.Union] | type[Structure] | type[Array[Any]]] | tuple[str, type[_SimpleCData[Any]] | type[_Pointer[Any]] | type[CFuncPtr] | type[_ctypes.Union] | type[Structure] | type[Array[Any]], int]"  [list-item]

nox (https://github.com/wntrblm/nox)
+ nox/tox_to_nox.py:128: error: Argument 1 to "Path" has incompatible type "Optional[str]"; expected "Union[str, PathLike[str]]"  [arg-type]

tornado (https://github.com/tornadoweb/tornado)
+ tornado/websocket.py:775: error: Incompatible return value type (got "_Decompress", expected "_Decompressor")  [return-value]
+ tornado/websocket.py:775: note: Protocol member _Decompressor.unconsumed_tail expected settable variable, got read-only attribute

pwndbg (https://github.com/pwndbg/pwndbg)
+ pwndbg/aglib/heap/structs.py: note: In member "read_field" of class "CStruct2GDB":
+ pwndbg/aglib/heap/structs.py:175: error: Item "_PyCSimpleType" of "type[_SimpleCData[Any]] | type[_Pointer[Any]] | type[CFuncPtr] | type[_ctypes.Union] | type[Structure] | type[Array[Any]]" has no attribute "_type_"  [union-attr]
+ pwndbg/aglib/heap/structs.py:175: error: Access to generic instance variables via class is ambiguous  [misc]
+ pwndbg/aglib/heap/structs.py:175: error: Item "_PyCFuncPtrType" of "type[_SimpleCData[Any]] | type[_Pointer[Any]] | type[CFuncPtr] | type[_ctypes.Union] | type[Structure] | type[Array[Any]]" has no attribute "_type_"  [union-attr]
+ pwndbg/aglib/heap/structs.py:175: error: Invalid index type "Any | type[Any] | _CField[Any, Any, Any] | overloaded function" for "dict[type[object], Type]"; expected type "type[object]"  [index]
+ pwndbg/aglib/heap/structs.py:177: error: Argument 1 to "array" of "Type" has incompatible type "Any | _CField[Any, Any, Any] | overloaded function"; expected "int"  [arg-type]
+ pwndbg/aglib/heap/structs.py: note: In member "fields" of class "CStruct2GDB":
+ pwndbg/aglib/heap/structs.py:206: error: Item "_PyCSimpleType" of "type[_SimpleCData[Any]] | type[_Pointer[Any]] | type[CFuncPtr] | type[_ctypes.Union] | type[Structure] | type[Array[Any]]" has no attribute "_type_"  [union-attr]
+ pwndbg/aglib/heap/structs.py:206: error: Access to generic instance variables via class is ambiguous  [misc]
+ pwndbg/aglib/heap/structs.py:206: error: Item "_PyCFuncPtrType" of "type[_SimpleCData[Any]] | type[_Pointer[Any]] | type[CFuncPtr] | type[_ctypes.Union] | type[Structure] | type[Array[Any]]" has no attribute "_type_"  [union-attr]
+ pwndbg/aglib/heap/structs.py:206: error: Invalid index type "Any | type[Any] | _CField[Any, Any, Any] | overloaded function" for "dict[type[object], Type]"; expected type "type[object]"  [index]
+ pwndbg/aglib/heap/structs.py:207: error: Argument 1 to "array" of "Type" has incompatible type "Any | _CField[Any, Any, Any] | overloaded function"; expected "int"  [arg-type]

trio (https://github.com/python-trio/trio)
+ src/trio/_core/_concat_tb.py:65: error: Unused "type: ignore" comment  [unused-ignore]
+ src/trio/_core/_concat_tb.py:69: error: Unused "type: ignore" comment  [unused-ignore]
+ src/trio/_core/_concat_tb.py:72: error: Unused "type: ignore" comment  [unused-ignore]
+ src/trio/socket.py:30: error: Unused "type: ignore" comment  [unused-ignore]

core (https://github.com/home-assistant/core)
+ homeassistant/helpers/template.py:535: error: Name "sys._OptExcInfo" is not defined  [name-defined]

dulwich (https://github.com/dulwich/dulwich)
+ dulwich/objects.py:548: error: Incompatible return value type (got "FixedSha | HASH", expected "HASH")  [return-value]

@JelleZijlstra JelleZijlstra merged commit 9405bfd into master Dec 1, 2024
19 checks passed
@JelleZijlstra JelleZijlstra deleted the mypybot/sync-typeshed branch December 1, 2024 01:33
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.

5 participants