Skip to content

Commit 33231dc

Browse files
committed
untouched defaultdict is considered empty
1 parent e0548d9 commit 33231dc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/compas/artists/colordict.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ def __get__(self, obj, otype=None):
7979
8080
"""
8181
default = getattr(obj, self.default_name)
82-
return getattr(obj, self.private_name) or defaultdict(lambda: default)
82+
d = getattr(obj, self.private_name)
83+
if d is not None:
84+
return d
85+
return defaultdict(lambda: default)
8386

8487
def __set__(self, obj, value):
8588
"""Set a new value for the descriptor.

0 commit comments

Comments
 (0)