Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions autoconf/dictable.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ def compound_key_dict(obj):


def to_dict(obj, filter_args: Tuple[str, ...] = ()) -> dict:
if hasattr(obj, "dict"):
try:
return obj.dict()
except TypeError as e:
logger.debug(e)

if isinstance(obj, (int, float, str, bool, type(None))):
return obj

Expand All @@ -88,12 +94,6 @@ def to_dict(obj, filter_args: Tuple[str, ...] = ()) -> dict:
"class_path": obj.__module__ + "." + obj.__qualname__,
}

if hasattr(obj, "dict"):
try:
return obj.dict()
except TypeError as e:
logger.debug(e)

if is_array(obj):
try:
return nd_array_as_dict(obj)
Expand Down