Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c7da2ec

Browse files
authored
Merge pull request #24234 from rgommers/avoid-min-max-starimport
MAINT: exclude min, max and round from `np.__all__`
2 parents 0497378 + 394a9f8 commit c7da2ec

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

numpy/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,12 @@
235235
__all__.extend(lib.__all__)
236236
__all__.extend(['linalg', 'fft', 'random', 'ctypeslib', 'ma'])
237237

238+
# Remove min and max from __all__ to avoid `from numpy import *` override
239+
# the builtins min/max. Temporary fix for 1.25.x/1.26.x, see gh-24229.
240+
__all__.remove('min')
241+
__all__.remove('max')
242+
__all__.remove('round')
243+
238244
# Remove one of the two occurrences of `issubdtype`, which is exposed as
239245
# both `numpy.core.issubdtype` and `numpy.lib.issubdtype`.
240246
__all__.remove('issubdtype')

0 commit comments

Comments
 (0)