Skip to content

API: Update lib.type_check namespace #24537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 28, 2023

Conversation

mtsokol
Copy link
Member

@mtsokol mtsokol commented Aug 25, 2023

Relevant issue #24507

Hi @rgommers @ngoldbaum,

This PR moves lib.type_check module to a private file and ensures that its public methods are only available through the main namespace. There are no additional functions available from a local namespace.

Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @mtsokol. Can you rebase to fix the conflicts?

@rgommers rgommers added this to the 2.0.0 release milestone Aug 25, 2023
@mtsokol mtsokol force-pushed the lib-typecheck-namespace branch from 2f11e49 to cb60e03 Compare August 26, 2023 15:35
@mtsokol
Copy link
Member Author

mtsokol commented Aug 26, 2023

LGTM, thanks @mtsokol. Can you rebase to fix the conflicts?

Sure! Rebased.

@rgommers
Copy link
Member

This one will need another rebase.

@mtsokol mtsokol force-pushed the lib-typecheck-namespace branch from cb60e03 to 4e1f7cf Compare August 27, 2023 12:31
@mtsokol
Copy link
Member Author

mtsokol commented Aug 27, 2023

This one will need another rebase.

Done!

Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

Thanks Mateusz, this LGTM now.

After the slight hiccup with function_base, I verified manually which function names are removed from the numpy.lib namespace with this PR. Those are:

['isrealobj',
 'imag',
 'iscomplexobj',
 'isreal',
 'real_if_close',
 'common_type',
 'iscomplex',
 'real',
 'typename',
 'mintypecode',
 'nan_to_num']

All of these are available in the main namespace and nothing looks like it should stay in numpy.lib, so this all looks fine.

@rgommers rgommers merged commit a277f62 into numpy:main Aug 28, 2023
@mtsokol mtsokol deleted the lib-typecheck-namespace branch August 28, 2023 10:20
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.

2 participants