NumPy 2.4.0 Release Notes#
Highlights#
We’ll choose highlights for this release near the end of the release cycle.
Compatibility notes#
NumPy’s C extension modules have begun to use multi-phase initialisation, as defined by PEP 489. As part of this, a new explicit check has been added that each such module is only imported once per Python process. This comes with the side-effect that deleting
numpy
fromsys.modules
and re-importing it will now fail with anImportError
. This has always been unsafe, with unexpected side-effects, though did not previously raise an error.(gh-29030)
Changes#
Multiplication between a string and integer now raises OverflowError instead of MemoryError if the result of the multiplication would create a string that is too large to be represented. This follows Python’s behavior.
(gh-29060)