News for hackers. Stuff that matters.
Re:What's New in Python 3.12 by smilliken on Wednesday October 18, 2023 @02:21PM (#37932595)
The issue is if the dictionary has a key defined and the value is None. Your get expression will return None, causing your next access to raise an error.
Re:What's New in Python 3.12 by ddejohn on Wednesday October 18, 2023 @02:32PM (#37932731)
Ah, I see. Still, I'd just catch that exception and move on because it's obvious you won't have anything more deeply nested anyway. Blowing up on `None` is an easy short-circuit.