Anyone who’s worked with Python knows that modules can be a Godsend, saving you time, effort, and many lines of code. They even have namespacing built-in 💪 😍 To expand on this a bit: However, not all ways of using modules are equally beneficial. In this article, we will discuss why using import * can… Continue reading ⚠️Why you should avoid import * in Python 🐍
Bob Belderbos
Bob studied business economics, but got fired up about programming early in his career. He taught himself web design / coding and started living his biggest passion: automate the boring stuff, making other people's lives easier. Since then he has coded projects accruing millions in cost savings and built a coding platform that has taught Python to thousands of people worldwide. He deeply cares about helping other people succeed. His biggest win will be your next win!
The Arbitrary (Keyword) Arguments (args and kwargs) don’t come “for free” in Python
By Bob Belderbos on 9 August 2023
Python allows you to use *args and **kwargs in function definitions to accept an arbitrary number of positional and keyword arguments, respectively. Here is a simple example: Different types of function arguments In the above example, the arbitrary_args function is defined to accept any number of positional and keyword arguments using the *args and **kwargs… Continue reading The Arbitrary (Keyword) Arguments (args and kwargs) don’t come “for free” in Python
Avoiding Silent Failures in Python: Best Practices for Error Handling
By Bob Belderbos on 7 August 2023
In the world of programming, errors are inevitable. But how we choose to handle these errors can make the difference between a system that is robust and user-friendly and one that is fraught with ambiguous issues 😱 The Zen of Python famously states, “Errors should never pass silently.” This principle emphasizes the importance of addressing… Continue reading Avoiding Silent Failures in Python: Best Practices for Error Handling
How to better streamline your Python project using a Makefile
By Bob Belderbos on 2 August 2023
Makefiles are awesome, and you can use them in your Python projects too (they are not only to compile and build C/C++ projects that is) 😎 They help you automate various tasks and streamline the development process overall 🚀 They allow you to: – Manage dependencies– Run tests– Build documentation– Format your code– Lint and… Continue reading How to better streamline your Python project using a Makefile
Why is Flat Better Than Nested? (Zen of Python)
By Bob Belderbos on 1 August 2023
The short answer: deeply nested code can be hard to read and understand (and this not only applies to Python, but for any code really). Each level of indentation adds a level of complexity and an additional condition that the reader (which is often you!) has to keep in their head while trying to understand… Continue reading Why is Flat Better Than Nested? (Zen of Python)
5 tips to learn any new Python library faster
By Bob Belderbos on 19 April 2023
This was a Pybites email first. To always get the latest and greatest content, subscribe here. Lately I have been learning some new libraries for weekly PDM Code Clinic demo sessions (e.g. PyScript, Flet, PySimpleGUI, Playwright, htmx, Redis, Leaflet, etc.) There is a general approach I take that makes this less painful and more fun.… Continue reading 5 tips to learn any new Python library faster
Teachers aren’t the only ones who teach. As a developer you’re expected to do so too …
By Bob Belderbos on 2 March 2023
This article appeared first as a Pybites email. To receive this kind of content first, subscribe to our weekly newsletter. For a long time, I thought I should not make mistakes when teaching other developers. I would hide behind slides because they were “hardcoded”, safe, or I’d do a lot of editing of my coding… Continue reading Teachers aren’t the only ones who teach. As a developer you’re expected to do so too …
Reflections on the Zen of Python
By Bob Belderbos on 21 December 2022
An initial version of this article appeared as a Pybites email first. If you like it join our friends list to get our valuable Python, developer and mindset content first … How following the Zen of Python will make your code better, a lot better. This epic set of axioms (triggered by typing import this in the… Continue reading Reflections on the Zen of Python
Building a 500 line API regression test suite
By Bob Belderbos on 15 December 2022
This article appeared as a Pybites email first. If you like it consider joining our friends list for weekly Python, developer and (!) mindset content … Last year I built a cool API to post code images using our pybites-carbon tool. It will store the tip code in a database and store the code image in an… Continue reading Building a 500 line API regression test suite
5 ways I use GitHub Actions
By Bob Belderbos on 14 December 2022
I am increasingly using GitHub Actions these days. If you’re new to this you might want to check out our article or video. In this article I will show you 5 cool ways I use it day to day. Run tests and linters The first and most obvious reason is to automate tooling. Although you probably want to… Continue reading 5 ways I use GitHub Actions