Closed binaryDiv closed 1 month ago
Adding the following implementation for __deepcopy__
to the BBAN
class seems to fix the issue. However, I'm not sure if this is the best solution or if that implementation should be done in the common.Base
class.
def __deepcopy__(self, memo):
cls = type(self)
return cls(str(self.country_code), str(self))
@binaryDiv Thanks for the heads-up! I added a corresponding implementation to the common.Base
-class.
Currently, when trying a
copy.deepcopy()
on anIBAN
object, an exception is raised. This can happen for example when deepcopying a dictionary that contains anIBAN
object.A simple
copy()
works perfectly fine, it even returns a new instance:However, a
deepcopy()
results in the following exception:I've tested this on the latest version of schwifty (2024.6.1) and Python 3.12.4.