5) Python by a JS programmer who has read PEP 8
I can’t find in pep8 that it would advisable to use `try … except KeyError` instead of `in` statement or any reference towards EAFP.
In this case `try/except` is wrong tool for the job. Much better:`if key in x: … else ...`.
Try/except has it’s issues: it’s 1) slow 2) is more verbose and 3) it may catch wrong errors (in this example key “pet” may be missing). The 3rd issue results in bugs that are terribly hard to debug.