5
Just Because You Can, It Doesn’t Mean You Should…
Python has a great many capabilities that exist for good reasons. However, many of these features create what jurists call an “attractive nuisance.”1 This chapter is a mixture of positive and negative advice, in truth. It presents some slightly unusual constructs that a new Python developer often learns and becomes excited about, before finally stumbling over the pitfalls those possibilities present. Hopefully, reading the mistakes here will facilitate the learning part but discourage the misuse follow-up. In some other mistakes, I simply discuss some techniques that people new to Python may not have known about (but which are mistakes not to avail yourself of); in one case (and another half ...
Get Better Python Code: A Guide for Aspiring Experts now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.