Author: Dan Bader
Date read: 2023-02-02
Python Tricks is a fascinating book for intermediate Python developers that want to improve their skills. The book interestingly covers many topics of the language, from some basic concepts to advanced topics.
Some of the chapters that I specially enjoyed reading:
- Python's functions are cirst-class objects
- Every class needs a
__repr__
- Defining your own exception (e.g. ConfigurationError)
- Deep copy and shallow copy
- NamedTuples
- Data structures: Stacks, Queues, Dequeues (double ended queues)
- List comprehensions
- Iterators
- Generators are simplified iterators
- Exploring Python modules with
dir()
andhelp()
The author explains the concepts with a very reasonable pace; slow enough to make them learnable, fast enough no to make things boarding.
Rating: 5/5