Open denis-migdal opened 11 months ago
I don't agree that either test should return True
, a Javascript Array is not the same type as a Python list or tuple
from browser import window
t = window.js_list
print(hasattr(t, 'push')) # True
t = [1]
print(hasattr(t, 'push')) # False
Shouldn't they convert to one in jsobj2pyobj
?
Or to be put in a wrapper JSList
inheriting from List
, or JSTuple
inheriting from Tuple
, depending on what Object.isFrozen(jsarray)
returns ?
isinstance(arr, list)
/isinstance(arr, tuple)
doesn't work properly on JS arrays (one of them should betrue
.Maybe will be fixed by the PR I made a few time back.