Closed
Description
Since boolean values namely True
and False
are hashable they can be used as dictionary keys -
def f():
d: dict[bool,i32]
d = {True: 1, False: 0}
print(d)
f()
(lp) C:\Users\kunni\lpython>python try.py
{True: 1, False: 0}
(lp) C:\Users\kunni\lpython>src\bin\lpython try.py
Internal Compiler Error: Unhandled exception
Traceback (most recent call last):
LCompilersException: Hashing bool isn't implemented yet.
I am working on this. @czgdp1807 @certik is there a way / design that should be followed to implement the hashing ? Kindly let me know any reference prs / issues I should follow.
Metadata
Metadata
Assignees
Labels
No labels