Skip to content

Commit

Permalink
use isinstance() for direct type comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
christianhelle committed Oct 19, 2024
1 parent 000f7e7 commit 444aae7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/autofaker/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def _get_type_name(t) -> str:
# because it will always be a string. This is because, annotations
# transforms any type into a string object. Therefore, if the type
# is a string, assess if it is the name of a known primitive type.
elif type(t) == str and t in PRIMITIVE_TYPES:
elif t.isinstance(str) and t in PRIMITIVE_TYPES:
return t
return type(t).__name__

Expand Down

0 comments on commit 444aae7

Please sign in to comment.