Skip to content

TYP: change type annotation for __array_namespace__ to ModuleType#20719

Merged
BvB93 merged 1 commit intonumpy:mainfrom
rgommers:array-namespace-typehint
Jan 3, 2022
Merged

TYP: change type annotation for __array_namespace__ to ModuleType#20719
BvB93 merged 1 commit intonumpy:mainfrom
rgommers:array-namespace-typehint

Conversation

@rgommers
Copy link
Copy Markdown
Member

@rgommers rgommers commented Jan 3, 2022

This is more precise, we are returning a module here. Type checkers will be able to use this info in the future - see data-apis/array-api#267

This is more precise, we are returning a module here. Type checkers
will be able to use this info in the future - see
data-apis/array-api#267
@rgommers rgommers added this to the 1.23.0 release milestone Jan 3, 2022
@rgommers rgommers requested a review from BvB93 January 3, 2022 21:45
@charris charris added the 09 - Backport-Candidate PRs tagged should be backported label Jan 3, 2022
@charris charris modified the milestones: 1.23.0 release, 1.22.0 release Jan 3, 2022
Copy link
Copy Markdown
Member

@BvB93 BvB93 left a comment

Choose a reason for hiding this comment

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

LGTM, it seems the necasary ModuleType.__getattr__ changes are available as of mypy 0.930.

@BvB93 BvB93 merged commit 7913796 into numpy:main Jan 3, 2022
@BvB93
Copy link
Copy Markdown
Member

BvB93 commented Jan 3, 2022

Thanks @rgommers.

@BvB93
Copy link
Copy Markdown
Member

BvB93 commented Jan 3, 2022

Not sure if this needs a backport though, considering the changes in this PR don't deal with any false positives (though feel free to leave the backport-candidate label if you want it backported).

@charris
Copy link
Copy Markdown
Member

charris commented Jan 3, 2022

@bas I am mostly prompted by "in the future". General adoption of a numpy version can take a year or more.

@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Jan 4, 2022
@charris charris removed this from the 1.22.0 release milestone Jan 4, 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