Copyable#

class pybrops.core.io.Copyable.Copyable[source]#

Bases: object

Abstract class for defining objects which can be copied.

This abstract class defines four functions with the following purposes:

  • __copy__ and __deepcopy__ implement the Python copy interface.

  • copy and deepcopy allow for the direct copying of objects.

Methods

copy

Make a shallow copy of the Copyable object.

deepcopy

Make a deep copy of the Copyable object.

abstract copy()[source]#

Make a shallow copy of the Copyable object.

Returns:

out – A shallow copy of the Copyable object.

Return type:

Copyable

abstract deepcopy(memo)[source]#

Make a deep copy of the Copyable object.

Parameters:

memo (dict, None) – An optional dictionary of memo metadata.

Returns:

out – A deep copy of the Copyable object.

Return type:

Copyable