Skip to content

MAINT: Split numpy.typing into a public and private component#21216

Merged
charris merged 4 commits intonumpy:mainfrom
BvB93:_typing
Mar 25, 2022
Merged

MAINT: Split numpy.typing into a public and private component#21216
charris merged 4 commits intonumpy:mainfrom
BvB93:_typing

Conversation

@BvB93
Copy link
Copy Markdown
Member

@BvB93 BvB93 commented Mar 18, 2022

Closes #21214

This PR does accomplishes two things:

  • It splits numpy.typing into a public and private sub-package, allowing a greater degree of separation of the public interface from the list of private types and type-aliases. This one in particular has been on my wish list for some time due to the ever growing number of private members.
  • While the public members of the (previously unified) numpy.typing sub-package were already explicitly marked as re-exported, this was not the case for its' private members, resulting in BUG: Usage of implicit reexports breaks using mypy with --no-implicit-reexport #21214. This issues has been rectified in 70176f6, which should be backported to 1.22.4 (I'll create a PR once this one is merged, as I anticipate a merge conflict or two).

@BvB93
Copy link
Copy Markdown
Member Author

BvB93 commented Mar 18, 2022

The linting errors pertain a number of docstrings and Literal types that aren't worth reformatting in my opinion.

@charris
Copy link
Copy Markdown
Member

charris commented Mar 25, 2022

I ignore linting for the typing files :) We can always look at cleaning them up later if it seems appropriate.

I haven't really looked at the code here, just scanned to see what you did. I figure if there are problems they will be discovered down stream and you will fix them. So in it goes.

Thanks Bas.

@charris charris merged commit 266aad7 into numpy:main Mar 25, 2022
@BvB93 BvB93 deleted the _typing branch March 25, 2022 15:43
@BvB93
Copy link
Copy Markdown
Member Author

BvB93 commented Mar 25, 2022

I wouldn't anticipate any issues unless people are using private API; most of the changes introduced herein can basically be boiled down to renaming typing to _typing.

@BvB93 BvB93 removed the 09 - Backport-Candidate PRs tagged should be backported label Mar 25, 2022
@BvB93 BvB93 removed this from the 1.22.4 release milestone Mar 25, 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.

BUG: Usage of implicit reexports breaks using mypy with --no-implicit-reexport

2 participants