I'm trying to write the Crystal equivalent of this Python code:
test_hash = {}
test_hash[1] = 2
print(1 in test_hash)
This prints True, because 1 is one of the keys of the dict.
Here's the Crystal code that I've tried:
# Create new Hash
test_hash = Hash(Int32, Int32).new
# Map 1 to 2
test_hash[1] = 2
# Check if the Hash includes 1
pp! test_hash.includes?(1)
But includes?
returns false here. Why? What's the correct equivalent of my Python code?