From 1054502d5d9e07c9d1cfaa48ab1b7ec8ae1c225e Mon Sep 17 00:00:00 2001 From: olliemath Date: Sun, 8 Aug 2021 10:04:18 +0100 Subject: [PATCH] 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. --- clickhouse_orm/utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/clickhouse_orm/utils.py b/clickhouse_orm/utils.py index ef79c27..d734914 100644 --- a/clickhouse_orm/utils.py +++ b/clickhouse_orm/utils.py @@ -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()