Hacker News new | past | comments | ask | show | jobs | submit
The square bracket version tells the reader it's required, the .get version tells the reader it's optional. Kind of the reason both exist in the language (the .get version has an optional second argument to return instead of None when the key is missing).
The point is that the implementer shouldn’t have to investigate to know whether the key’s value is nullable.