Bugfix: fix NO_VALUE copy semantics

Previously copying the NO_VALUE singleton would yield a different
instance. This caused some problems. Now it really is a singleton.
This commit is contained in:
olliemath 2021-08-08 10:04:18 +01:00
parent 84302aa172
commit 1054502d5d

View File

@ -154,5 +154,11 @@ class NoValue:
def __repr__(self):
return "NO_VALUE"
def __copy__(self):
return self
def __deepcopy__(self, memo):
return self
NO_VALUE = NoValue()