You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using the try / except style as EAFP is generally more pythonic. But see here for a more nuanced discussion. Could see a case made for either direction. Kinda depends what we're trying to convey with the control flow, eg what is "expected" vs "exceptional"
So basically the intent is that is it a normal use case or the exception that the key is missing. In many of our cases its a or statement between the two different keys where both can be as equally likely. I think that the try except pattern we have works fine.
Today we used the following pattern:
We might want to change into:
Am not convinced of which pattern is best at this time. I just wanted to raise the question.
The text was updated successfully, but these errors were encountered: