You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I guess not because they can't be sent as function arguments and this program gives a runtime error:
from __static__ import int64, Array, CheckedList, CheckedDict
def create(n: int):
d = CheckedDict[int64, bool]()
nn = int64(n)
if not d[nn]:
d[nn] = True
return
create(4)
But the error message is very confusing:
....
File "test.py", line 6, in create
if not d[nn]:
TypeError: chkdict[int64, bool].__getitem__()() argument 1 expected int64
Argument 1 is an int64 ... right?!
The text was updated successfully, but these errors were encountered:
Are primitives like
int64
allowed as Dict keys?I guess not because they can't be sent as function arguments and this program gives a runtime error:
But the error message is very confusing:
Argument 1 is an
int64
... right?!The text was updated successfully, but these errors were encountered: