Skip to content

Commit

Permalink
Optimize parse_value type checking
Browse files Browse the repository at this point in the history
  • Loading branch information
srfwx committed Dec 5, 2024
1 parent 1f61ece commit 3df1bab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pynetbox/core/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,12 +388,12 @@ def list_parser(key_name, value):
return value, [*value]

def parse_value(key_name, value):
if not isinstance(value, (dict, list)):
to_cache = value
elif isinstance(value, dict):
if isinstance(value, dict):
value, to_cache = dict_parser(key_name, value)
elif isinstance(value, list):
value, to_cache = list_parser(key_name, value)
else:
to_cache = value
setattr(self, key_name, value)
return to_cache

Expand Down

0 comments on commit 3df1bab

Please sign in to comment.