Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e947dbc

Browse filesBrowse files
committed
MNT: use copy.deepcopy to implement deepcopy method
We provide deepcopy and copy methods as a shortcut for users to avoid having to import the copy module and call the required function. Directly calling `__deepcopy__` side-steps all of the memoization machinery and may lead to incorrect results.
1 parent 4af11e7 commit e947dbc
Copy full SHA for e947dbc

File tree

1 file changed

+6
-1
lines changed
Filter options

1 file changed

+6
-1
lines changed

‎lib/matplotlib/path.py

Copy file name to clipboardExpand all lines: lib/matplotlib/path.py
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,12 @@ def __deepcopy__(self, memo=None):
285285
p._readonly = False
286286
return p
287287

288-
deepcopy = __deepcopy__
288+
def deepcopy(self, memo=None):
289+
"""
290+
Return a shallow copy of the `Path`, which will share the
291+
vertices and codes with the source `Path`.
292+
"""
293+
return copy.deepcopy(self, memo=memo)
289294

290295
@classmethod
291296
def make_compound_path_from_polys(cls, XY):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.