Skip to content

FUTURE BUG: reconsider how we deep-copy path objects #29157 #29161

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

Closed
wants to merge 2 commits into from
Closed

FUTURE BUG: reconsider how we deep-copy path objects #29157 #29161

wants to merge 2 commits into from

Conversation

saikarna913
Copy link
Contributor

PR summary

  • it is necessary to solve the infinite recursion in __deep_copy__ function in path.py
  • it is creating the deep copy without infinite recursion
  • adding the memo dictionary with id as the self and value as the new instance created , makes the deep copy to stop the infinite recursion when same class is called since in MRO, the object will be the path class since there are no super classes for the path class which searches for __deep_copy__

PR checklist

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join us on gitter for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide

We strive to be a welcoming and open project. Please follow our Code of Conduct.

@tacaswell
Copy link
Member

See #21280 for the context of why we are using super(). We want to say "do the normal deepcopy thing and then make an extra change before it goes back to the user" and the original motivation for this was to fix deepcopy for Path sub-classes where super() may have a non-trivial MRO to walk.

@rcomer
Copy link
Member

rcomer commented Nov 24, 2024

This PR requires a high level of python knowledge/experience, certainly beyond my level. @saikarna913 since you have opened a new PR against an easier issue, did you decide this one is also beyond your level? If so we should close this to signal to other contributors that the issue is available to work on.

@saikarna913 saikarna913 closed this by deleting the head repository Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for author
Development

Successfully merging this pull request may close these issues.

FUTURE BUG: reconsider how we deep-copy path objects
3 participants