You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we are invoking copy.deepcopy(self) when trying to copy a CassiopeiaTree. It would be better to implement a custom version of both copy and deepcopy for users. See https://docs.python.org/3/library/copy.html , specifically:
In order for a class to define its own copy implementation, it can define special methods copy() and deepcopy(). The former is called to implement the shallow copy operation; no additional arguments are passed. The latter is called to implement the deep copy operation; it is passed one argument, the memo dictionary. If the deepcopy() implementation needs to make a deep copy of a component, it should call the deepcopy() function with the component as first argument and the memo dictionary as second argument.
The text was updated successfully, but these errors were encountered:
Currently we are invoking
copy.deepcopy(self)
when trying to copy a CassiopeiaTree. It would be better to implement a custom version of bothcopy
anddeepcopy
for users. See https://docs.python.org/3/library/copy.html , specifically:In order for a class to define its own copy implementation, it can define special methods copy() and deepcopy(). The former is called to implement the shallow copy operation; no additional arguments are passed. The latter is called to implement the deep copy operation; it is passed one argument, the memo dictionary. If the deepcopy() implementation needs to make a deep copy of a component, it should call the deepcopy() function with the component as first argument and the memo dictionary as second argument.
The text was updated successfully, but these errors were encountered: