Serdar Yegulalp
Senior Writer

Got the Python basics down? Read this book next

feature
Feb 4, 20213 mins

A great new book from the author of โ€˜Automate the Boring Stuff with Pythonโ€™ helps you move past beginning concepts and embrace pro-level Python skills.

certification woman on laptop programmer devops data scientist by picjumbo
Credit: picjumbo

For many programmers, the hardest part isnโ€™t the first few steps. Itโ€™s the leap from knowing the basics to writing elegant, expressive code. Python programmers often find this hill as difficult to climb as learners of more complex languages.

Al Sweigart, author of the excellent Automate the Boring Stuff with Python, aims to do something about that with his new book, Beyond the Basic Stuff with Python. The earlier book was aimed at absolute beginners who wanted to get started with Python and do practical, useful things out of the gate. The new book is in some respects a successor to Automate, but as Sweigart notes in his introduction, Beyond the Basic Stuff can follow up most any introductory book to Python.

Sweigart focuses on three major subjects: common difficulties in getting started (seeking help, setting up a work environment); best practices, tools, and techniques; and using object-oriented Python. The second section is the largest in the book and somewhat sprawlingโ€”perhaps the parts on tools, like black and git, could have been spun off separatelyโ€”but each section can be read on its own.

The book is all the more useful for collecting together between one pair of covers material that you would typically dig up from multiple resources. Many of the chapters deal with code styleโ€”not just formatting with tools like black, but dealing with code โ€œsmellsโ€ (bad habits that often spawn bugs), making code more โ€œPythonicโ€ (using Pythonโ€™s native idioms well), and avoiding some of the gotchas afflicting even seasoned developers.

Sweigart takes time to explain the goals or motivation behind specific advice. With gotchas, for instance, thereโ€™s a detailed treatment of a common Python pitfall: how to deal with changing the contents of a list youโ€™re looping over. Sweigart doesnโ€™t just say, โ€œDonโ€™t change an existing list, create a new list and append to it.โ€ Rather, he walks you through the details of why modifying a list as you loop through it can have unpredictable results. He even takes the time to dispel worries about why the suggested solution is not as inefficient as it might seem.

Many of the chapters serve as good jumping-off points for more involved study. However, that doesnโ€™t mean theyโ€™re skimpy, just concise. An entire book could be written about Python performance optimizationsโ€”in fact, one has beenโ€”but Sweigart touches on some of the most important aspects of that in one chapter. He takes the time to explain the concept of algorithmic time complexity, or big-O notation, in plain language, and walks the reader through using cProfile to garner live performance statistics about their apps.

Some of the most difficult concepts for a newly minted Python programmer to grok are object-oriented programming (OOP) and classes. Sweigart devotes an entire subsection of the book, three chapters, to explaining how OOP and classes work in Python. Sweigart uses a slew of sensible real-world examples to do this, from the usual โ€œclass = car blueprint, object instance = carโ€ example to more nuanced ones. Most importantly, he connects the behaviors and components of classes with Python concepts beginners are already familiar with, useful context not always provided in these discussions.

There are other books for Pythonistas who have graduated from basic training and want to move to the next level.ย Fluent Python, for instance, is an overall guide to making code more โ€œPythonic,โ€ as the Python masters put it.ย Beyond the Basic Stuff with Python aims more broadly than just code.

Serdar Yegulalp

Serdar Yegulalp is a senior writer at InfoWorld. A veteran technology journalist, Serdar has been writing about computers, operating systems, databases, programming, and other information technology topics for 30 years. Before joining InfoWorld in 2013, Serdar wrote for Windows Magazine, InformationWeek, Byte, and a slew of other publications. At InfoWorld, Serdar has covered software development, devops, containerization, machine learning, and artificial intelligence, winning several B2B journalism awards including a 2024 Neal Award and a 2025 Azbee Award for best instructional content and best how-to article, respectively. He currently focuses on software development tools and technologies and major programming languages including Python, Rust, Go, Zig, and Wasm. Tune into his weekly Dev with Serdar videos for programming tips and techniques and close looks at programming libraries and tools.

More from this author