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 9ec6cb7

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 f2717a5 commit 9ec6cb7
Copy full SHA for 9ec6cb7

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
@@ -286,7 +286,12 @@ def __deepcopy__(self, memo=None):
286286
p._readonly = False
287287
return p
288288

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

291296
@classmethod
292297
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.