Fix Path deepcopy signature #6877

Merged
merged 1 commit into from Aug 3, 2016

Conversation

Projects
None yet
5 participants
Contributor

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.

mdboom added the needs_review label Aug 1, 2016

Contributor

dopplershift commented Aug 2, 2016 edited

👍 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 added this to the 2.0.1 (next bug fix release) milestone Aug 2, 2016

Owner

tacaswell commented Aug 2, 2016

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

Do we need to do anything with memo?

Contributor

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.

Contributor

dopplershift commented Aug 2, 2016

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

@has2k1 has2k1 Fix Path deepcopy signature
**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.
cfe45cd
Contributor

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

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.0004%) to 70.842%
Details

tacaswell removed the needs_review label Aug 3, 2016

@tacaswell tacaswell added a commit that referenced this pull request Aug 3, 2016

@tacaswell tacaswell Merge pull request #6877 from has2k1/fix-deepcopy
FIX: Path deepcopy signature
b338a71
Owner

tacaswell commented Aug 3, 2016

Backported to v2.x as b338a71

@has2k1 Thanks!

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