@@ -66,10 +66,6 @@ class CopyMixin(ABC):
6666 _copy_only_reference : list [str ] = [
6767 "_model" ,
6868 ]
69- # Attributes listed here are not copied at all and will not be set
70- # on the copied object. Useful for lazily re-creating cyclic or
71- # parent-bound helpers (e.g., accessors) after copy/deepcopy.
72- _skip_copy : list [str ] = []
7369
7470 @abstractmethod
7571 def __init__ (self ): ...
@@ -117,7 +113,6 @@ def copy(
117113 for k , v in attributes .items ()
118114 if k not in self ._copy_with_method
119115 and k not in self ._copy_only_reference
120- and k not in self ._skip_copy
121116 and k not in skip
122117 ]
123118 else :
@@ -126,20 +121,15 @@ def copy(
126121 for k , v in self .__dict__ .items ()
127122 if k not in self ._copy_with_method
128123 and k not in self ._copy_only_reference
129- and k not in self ._skip_copy
130124 and k not in skip
131125 ]
132126
133127 # Copy attributes with a reference only
134128 for attr in self ._copy_only_reference :
135- if attr in self ._skip_copy or attr in skip :
136- continue
137129 setattr (obj , attr , getattr (self , attr ))
138130
139131 # Copy attributes with a specified method
140132 for attr in self ._copy_with_method :
141- if attr in self ._skip_copy or attr in skip :
142- continue
143133 attr_obj = getattr (self , attr )
144134 attr_copy_method , attr_copy_args = self ._copy_with_method [attr ]
145135 setattr (obj , attr , getattr (attr_obj , attr_copy_method )(* attr_copy_args ))
0 commit comments