Skip to content

Conversation

@sterliakov
Copy link
Collaborator

Fixes #20015, refs #18895 as a previous example of the same issue. I don't see any similar problems in other branches.

@github-actions
Copy link
Contributor

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

steam.py (https://github.com/Gobot1234/steam.py)
- steam/ext/commands/commands.py:285: error: Incompatible types in assignment (expression has type "GroupMixin[Any | None] | Group[Any, [VarArg(Any), KwArg(Any)], Any] | None", variable has type "Self")  [assignment]
+ steam/ext/commands/commands.py:285: error: Incompatible types in assignment (expression has type "GroupMixin[Any | None] | Group[CogT, [VarArg(Any), KwArg(Any)], Any] | None", variable has type "Self")  [assignment]

scikit-build-core (https://github.com/scikit-build/scikit-build-core)
+ src/scikit_build_core/metadata/__init__.py:82: error: Argument 1 has incompatible type "Union[str, dict[str, str]]"; expected "str"  [arg-type]
+ src/scikit_build_core/metadata/__init__.py:82: note: Error code "arg-type" not covered by "type: ignore" comment
+ src/scikit_build_core/metadata/__init__.py:89: error: Argument 1 has incompatible type "Union[str, list[str], dict[str, str]]"; expected "str"  [arg-type]
+ src/scikit_build_core/metadata/__init__.py:89: note: Error code "arg-type" not covered by "type: ignore" comment
+ src/scikit_build_core/metadata/__init__.py:94: error: Item "str" of "Union[str, dict[str, str]]" has no attribute "items"  [union-attr]
+ src/scikit_build_core/metadata/__init__.py:98: error: Item "str" of "Union[str, dict[str, str]]" has no attribute "items"  [union-attr]
+ src/scikit_build_core/metadata/__init__.py:98: note: Error code "union-attr" not covered by "type: ignore" comment
+ src/scikit_build_core/metadata/__init__.py:102: error: Left operand of "and" is always true  [redundant-expr]
+ src/scikit_build_core/metadata/__init__.py:108: error: Item "str" of "Union[str, list[str], dict[str, str]]" has no attribute "items"  [union-attr]
+ src/scikit_build_core/metadata/__init__.py:108: error: Item "list[str]" of "Union[str, list[str], dict[str, str]]" has no attribute "items"  [union-attr]

@sterliakov
Copy link
Collaborator Author

All scikit_build_core errors are correct, both arg-type and return-value should be there.

@sterliakov sterliakov marked this pull request as ready for review October 10, 2025 23:36
Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG, thanks!

@ilevkivskyi ilevkivskyi merged commit 6aa44da into python:master Oct 12, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NotImplementedError: Cannot serialize TypeGuardedType instance

2 participants