Book Announcement:
https://www.packtpub.com/en-us/product/modern-python-cookbook-9781835466384
There are about 130 recipes in here. Some new. Some revised. All examined (and tested) for Python 3.12.
For the Python folks who are just starting as well as those looking to pick up some more skills, this is for you
The recipes cover a wide variety of topics. It covers both functional and object-oriented programming.
Here's a run-down of the chapters (yes, it's a long list):
- Numbers, Strings, and Tuples
- Statements and Syntax
- Function Definitions
- Built-In Data Structures Part 1: Lists and Sets
- Built-In Data Structures Part 2: Dictionaries
- User Inputs and Outputs
- Basics of Classes and Objects
- More Advanced Class Design
- Functional Programming Features
- Working with Type Matching and Annotations
- Input/Output, Physical Format, and Logical Layout
- Graphics and Visualization with Jupyter Lab
- Application Integration: Configuration
- Application Integration: Combination
- Testing
- Dependencies and Virtual Environments
- Documentation and Style
Most chapters have recipes that include beginners as well as advanced developers. For example, the first chapter covers the differences between true division and floor division. Some folks get this deeply, where for others, it can feel cryptic at first.
Some chapters are based on others, making them less beginner-oriented. The Functional Programming Features chapter is based on the Function Definitions chapter. The More Advanced Class Design chapter builds on the Basics of Classes and Objects chapter.
Since the whole book is tested (both doctests and unit tests), I'm particularly fond of the Testing chapter. I have read posts from too many folks saying that testing isn't a thing in school, and at work, they're left on their own to work out what and how to test. I think I can help a little with some recipes on using docstrings, testing functions with exeptions, using unittest, using pytest, and mocking external resources.
I’m hoping you’ll find this useful for growing a deeper understanding of Python programming.