Code Sample of Book "Python Tricks: A Buffet of Awesome Python Feature" by Dan Bader
Mastering Python programming is not just about grasping the theoretical aspects of the language. It is just as much about about understanding and adopting the conventions and best practices used by its community.
- What is a Python Trick?
- What This Book will Do for You
- Covering Your A** With Assertions
- Complacent Comma Placement
- Context Manages and the with Statement
- Underscores, Dunders, and More
- "The Zen of Python" Easter Egg
- Python's Functions Are First-Class
- Lambdas Are Single-Expression Functions
- The Power of Decorators
- Fun With *args and **kwargs
- Function Argument Unpacking
- Nothing to Return Here