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

Skip to content

Fix Path deepcopy signature #6877

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

Merged
merged 1 commit into from
Aug 3, 2016
Merged

Conversation

has2k1
Copy link
Contributor

@has2k1 has2k1 commented Aug 1, 2016

Problem

Path.__deepcopy__ does not accept a second(memo) parameter,
so the common usage of the deepcopy function fails.

Solution

Add second parameter.

@dopplershift
Copy link
Contributor

dopplershift commented Aug 2, 2016

👍 For anyone else wanting more information on __deepcopy__ see: https://docs.python.org/3.5/library/copy.html?highlight=__deepcopy__

I don't think any of the tests failures were related--I restarted the failing Travis jobs to confirm. Can someone restart the AppVeyor job?

@tacaswell tacaswell added this to the 2.0.1 (next bug fix release) milestone Aug 2, 2016
@tacaswell
Copy link
Member

https://docs.python.org/3.5/library/copy.html?highlight=__deepcopy__ <- fixed the link for you 👿

Do we need to do anything with memo?

@has2k1
Copy link
Contributor Author

has2k1 commented Aug 2, 2016

memo is to deal any circular stuff. Since the class is offloads the copying of the relevant structures to numpy, then memo can be safely ignored.

However, hold on this until I can fix another issue with the copy. I am not in position to do so at the moment.

@dopplershift
Copy link
Contributor

@tacaswell What link problem? 😁 I blame Google/Python defaulting to 2.x on the docs when I search.

**Problem**

Path.__deepcopy__ does not accept a second(`memo`) parameter,
so the common usage of the `deepcopy` function fails.

**Solution**

Add second parameter. While at it, also take care of the case
of copying the `Path` without codes.
@has2k1
Copy link
Contributor Author

has2k1 commented Aug 3, 2016

Okay. I fixed the other issue of not being able to deecopy if the path had no codes.

@tacaswell tacaswell merged commit 3f7e675 into matplotlib:master Aug 3, 2016
tacaswell added a commit that referenced this pull request Aug 3, 2016
FIX: Path deepcopy signature
@tacaswell
Copy link
Member

Backported to v2.x as b338a71

@has2k1 Thanks!

@QuLogic QuLogic modified the milestones: 2.0 (style change major release), 2.0.1 (next bug fix release) Aug 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants