Skip to content

TST,TYP: Bump mypy to 0.981 - #22360

Merged
mattip merged 2 commits into
numpy:mainfrom
BvB93:mypy
Oct 2, 2022
Merged

mattip merged 2 commits into
numpy:mainfrom
BvB93:mypy

Conversation

@BvB93

@BvB93 BvB93 commented Sep 30, 2022

Copy link
Copy Markdown
Member

Bump mypy to version 0.981.

Marked as backport due as the test set required a few updates.

@BvB93 BvB93 added this to the 1.23.4 release milestone Sep 30, 2022
Comment on lines -73 to -74
complex(np.bytes_("1")) # E: No overload variant

@BvB93 BvB93 Sep 30, 2022 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Minor regression due to python/typeshed#8473, i.e. any object that defines __float__ is now treated as valid by the complex constructor (even though this will raise during runtime as being a bytes subclass takes priority).

Nothing we can really do here I'm afraid.

AR_void: npt.NDArray[np.void]

pointer: ctypes.pointer[Any]
pointer: ctypes._Pointer[Any]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Adapt to the ctypes.pointer changes in python/typeshed#8446.

reveal_type(a.coords) # E: tuple[builtins.int, ...]
reveal_type(a.index) # E: int
reveal_type(iter(a)) # E: flatiter[ndarray[Any, dtype[str_]]]
reveal_type(iter(a)) # E: Any

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

A minor regression introduced by python/typeshed#7817.
Seems to be a mypy bug as pylance does produce the expected result here.

@BvB93

BvB93 commented Sep 30, 2022

Copy link
Copy Markdown
Member Author

Mypy seems to use importlib API that's deprecated since python 3.11, hence the test failure.
PR python/mypy#13783 should take care of the deprecation warning, so I propose to just ignore the warning on our end for now.

@mattip
mattip merged commit a5d2c58 into numpy:main Oct 2, 2022
@mattip

mattip commented Oct 2, 2022

Copy link
Copy Markdown
Member

Thanks @BvB93

@BvB93
BvB93 deleted the mypy branch October 2, 2022 17:08
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants