Skip to content

Commit fe3effb

Browse files
committed
adds support for deepcopy, closes python-quantities#27
1 parent 3a06e32 commit fe3effb

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎quantities/quantity.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,10 @@ def __reduce__(self):
623623
(self.__class__, np.ndarray, (0, ), 'b', ),
624624
self.__getstate__())
625625

626+
def __deepcopy__(self, memo_dict):
627+
# constructor copies by default
628+
return Quantity(self.magnitude, self.dimensionality)
629+
626630

627631
def _reconstruct_quantity(subtype, baseclass, baseshape, basetype,):
628632
"""Internal function that builds a new MaskedArray from the

0 commit comments

Comments
 (0)