The Python “Mutable Default Argument” Trap (Why Your List is Not Empty)
This is the most famous “gotcha” in all of Python: the Mutable Default Argument bug. It’s a bug that confuses every developer exactly once. Look…

This is the most famous “gotcha” in all of Python: the Mutable Default Argument bug. It’s a bug that confuses every developer exactly once. Look…

You’ve built dozens of projects. To publish your package and make it easy for others to install, you’ll need to understand how to use Python…

This error looks scary, but it’s actually a helpful message from a developer. In Python, the NotImplementedError is not a bug; it’s a feature of…

In our intro to pytest, we learned how to use simple assert statements. But what if all your tests need the same setup data? You…

In our unittest guide, we learned how to write automated tests. This Python pytest guide will help you get started with the preferred testing tool….

If you’ve ever worked with huge files or infinite sequences, you’ve needed a generator. The keyword that powers them is yield. In this article, you’ll…

“Dunder” is short for “Double Underscore.” Dunder methods are special “magic” methods that Python reserves for its own use. You don’t call them directly, but…

We’ve automated Excel, but what about cloud data? If you’re looking to work efficiently with Google Sheets Python integration, gspread is a fantastic library for…

You’ve learned how to define a function that accepts *args and **kwargs. Now, we’ll learn the opposite: how to call a function using * and…

This error means a function is calling itself over and over again, in an infinite loop, until it hits a safety limit set by Python…
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
You can find more information about our Cookie Policy and Privacy Policy.