Skip to content

Conversation

eendebakpt
Copy link
Contributor

@eendebakpt eendebakpt commented Sep 2, 2025

The numpy scalars are immutable (expect for subclasses of np.void), so copy or deepcopy can return the same object. This improves performance, since the current implementation converts to array, copies and converts back to scalar.

@meet-vasita
Copy link

Thanks @eendebakpt! I see #29656 is running through CI now.

@eendebakpt eendebakpt changed the title Draft: [ENH] Improve performance of numpy scalar __copy__ and __deepcopy__ [ENH] Improve performance of numpy scalar __copy__ and __deepcopy__ Sep 3, 2025
@charris charris changed the title [ENH] Improve performance of numpy scalar __copy__ and __deepcopy__ ENH: Improve performance of numpy scalar __copy__ and __deepcopy__ Sep 3, 2025
@charris charris changed the title ENH: Improve performance of numpy scalar __copy__ and __deepcopy__ MAINT: Improve performance of numpy scalar __copy__ and __deepcopy__ Sep 4, 2025
@eendebakpt eendebakpt changed the title MAINT: Improve performance of numpy scalar __copy__ and __deepcopy__ ENH: Improve performance of numpy scalar __copy__ and __deepcopy__ Sep 4, 2025
@eendebakpt eendebakpt changed the title ENH: Improve performance of numpy scalar __copy__ and __deepcopy__ [ENH] Improve performance of numpy scalar __copy__ and __deepcopy__ Sep 4, 2025
@eendebakpt eendebakpt changed the title [ENH] Improve performance of numpy scalar __copy__ and __deepcopy__ ENH: Improve performance of numpy scalar __copy__ and __deepcopy__ Sep 4, 2025
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