News for hackers. Stuff that matters.
Re:The state of type hints in Python by bkad on Wednesday June 20, 2018 @09:37PM (#17361365)
dicts are like Maps in JavaScript, so the type of a key matters. It enables usecases where your keys aren't always strings:

  >> bar = {1: "a", "1": "b"}
  >> bar[1]
  "a"
  >> bar["1"]
  "b"

There are no comments on this comment yet.