Skip to content

Commit abd62a7

Browse files
committed
missing docstring info and check for mapping instead of dict
1 parent dd01a75 commit abd62a7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/compas/artists/colordict.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from collections import defaultdict
2+
from collections import Mapping
23
from compas.colors import Color
34

45

@@ -62,9 +63,9 @@ def __get__(self, obj, otype=None):
6263
Parameters
6364
----------
6465
obj : object
65-
The object owning the instance of the descriptor.
66-
otype : ???, optional
67-
???
66+
The instance owning the instance of the descriptor.
67+
otype : object, optional
68+
The type owning the instance of the descriptor.
6869
6970
Returns
7071
-------
@@ -94,7 +95,7 @@ def __set__(self, obj, value):
9495
if not value:
9596
return
9697

97-
if isinstance(value, dict):
98+
if isinstance(value, Mapping):
9899
default = getattr(obj, self.default_name)
99100
item_color = defaultdict(lambda: default)
100101
for item in value:

0 commit comments

Comments
 (0)