Skip to content

Conversation

@jfrost-mo
Copy link
Contributor

@jfrost-mo jfrost-mo commented Oct 27, 2025

🚀 Pull Request

Description

Currently a request for comment, as there is probably a better way to fix this, and I've not done all the checklist stuff yet.

The custom copy implementation for DimCoords causes a RecursionError under python 3.14 as the super() proxy object is now copied, instead of its copy implementation being used on the original object.

This change does lose the read-only latching on copy that DimCoords currently have, which is what makes me think there is a better way. On the other hand, is the DimCoord not being created with read-only points coordinates?

Fixes #6762


Consult Iris pull request check list


Add any of the below labels to trigger actions on this PR:

  • benchmark_this Request that this pull request be benchmarked to check if it introduces performance shifts

It causes a RecursionError under python 3.14 as the super() proxy object
is now copied, instead of its copy implementation being used.

This change does lose the read-only latching on copy that DimCoords
currently have.

Fixes SciTools#6762
@jfrost-mo jfrost-mo changed the title RFC: Remove custom __deepcopy__ for DimCoord RFC: Remove custom __deepcopy__ method from DimCoord Oct 27, 2025
@jfrost-mo
Copy link
Contributor Author

Unsurprisingly this broke the tests that were testing for it.

FAILED lib/iris/tests/unit/coords/test_DimCoord.py::Test_copy::test_writable_points - Failed: DID NOT RAISE <class 'ValueError'>
FAILED lib/iris/tests/unit/coords/test_DimCoord.py::Test_copy::test_realdata_readonly - Failed: DID NOT RAISE <class 'ValueError'>
==== 2 failed, 10420 passed, 54 skipped, 2403 warnings in 477.34s (0:07:57) ====

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

RecursionError when loading file in python 3.14

1 participant