4 ms·
Nice and concise. It would be complemented nicely by a list of Python "gotchas". E.g., off the top of my head, mutable default arguments, or trying to catch mu
by tveita 13y ago
Nice and concise. It would be complemented nicely by a list of Python "gotchas".
E.g., off the top of my head, mutable default arguments, or trying to catch multiple exceptions with "except Exception1, Exception2:". That's the kind of thing people new to the language can spend a lot of time debugging when they first run into it.
Edit: and any introduction to tuples should probably show how to write empty and one-element tuples, since that can be non-intuitive. Writing (1) instead of (1,) is also a fairly common gotcha.