Skip to content

Commit 05c97a4

Browse files
Fix type checking when casting (#30)
1 parent fdace93 commit 05c97a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jupyter_ydoc/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
def cast_all(o: Union[List, Dict], from_type, to_type) -> Union[List, Dict]:
55
if isinstance(o, list):
66
for i, v in enumerate(o):
7-
if isinstance(v, from_type):
7+
if type(v) == from_type:
88
o[i] = to_type(v)
99
elif isinstance(v, (list, dict)):
1010
cast_all(v, from_type, to_type)
1111
elif isinstance(o, dict):
1212
for k, v in o.items():
13-
if isinstance(v, from_type):
13+
if type(v) == from_type:
1414
o[k] = to_type(v)
1515
elif isinstance(v, (list, dict)):
1616
cast_all(v, from_type, to_type)

0 commit comments

Comments
 (0)