Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit990ffdf

Browse files
committed
Fix TransformNode.__copy__
without calling copy.copy
1 parent68d25b3 commit990ffdf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎lib/matplotlib/transforms.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
# `np.minimum` instead of the builtin `min`, and likewise for `max`. This is
3636
# done so that `nan`s are propagated, instead of being silently dropped.
3737

38-
importcopy
3938
importfunctools
4039
importitertools
4140
importtextwrap
@@ -139,7 +138,9 @@ def __setstate__(self, data_dict):
139138
fork,vinself._parents.items()ifvisnotNone}
140139

141140
def__copy__(self):
142-
other=copy.copy(super())
141+
cls=type(self)
142+
other=cls.__new__(cls)
143+
other.__dict__.update(self.__dict__)
143144
# If `c = a + b; a1 = copy(a)`, then modifications to `a1` do not
144145
# propagate back to `c`, i.e. we need to clear the parents of `a1`.
145146
other._parents= {}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp