I hope no one is recommending x.get as a general practice, because that is pretty naive.
I hope no one is recommending x.get as a general practice, because that is pretty naive.
If you're a very junior sw engineer reading this, who hasn't done a lot of python, use x.get(). Almost always, so for you, always. This doesn't apply if you're a scientist or mostly writing small scripts, but if you are doing SWE, always use x.get().
Once you've understood python you can use x[] in limited cases. Never in your unit or functional tests. I code using x[], but later on I replace a lot of them with getter (around my second refactoring, when I add type hints and tests) especially in library or code that'll be shared.
Non-python dev here.
But I was already rejected so I haven't been able to explain my logic :-). It's still nice to get their feedback, though.
Funny enough, in Europe, you _should_ be able to get any written notes on you via GDPR.