Skip to content

Commit

Permalink
Use isinstance instead of checking type
Browse files Browse the repository at this point in the history
  • Loading branch information
s3bw committed Jan 19, 2024
1 parent c26c3b9 commit f22903e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dataclasses_json/core.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
print("Hello world")
import copy
import json
import sys
Expand Down Expand Up @@ -200,7 +201,7 @@ def _decode_dataclass(cls, kvs, infer_missing):
if (field.name in overrides
and overrides[field.name].decoder is not None):
# FIXME hack
if field_type is type(field_value):
if isinstance(field_value, field_type):
init_kwargs[field.name] = field_value
else:
init_kwargs[field.name] = overrides[field.name].decoder(
Expand Down

0 comments on commit f22903e

Please sign in to comment.