Last time, we built a hybrid concurrent.futures executor using inheritance. Today, we're building it again (twice!) using composition and functions only, to figure out which way is better and why. Consider this a worked example.| death and gravity
...in which we build a hybrid concurrent.futures executor that runs I/O bound tasks on all available CPUs, thus evading the limitations imposed by the dreaded global interpreter lock on the humble ThreadPoolExecutor.| death and gravity
Hi there!| death and gravity
Hi there!| death and gravity
Hi there!| death and gravity
Hi there!| death and gravity
Hi there!| death and gravity
Java is notoriously verbose, especially when used in a serious Enterprise Project™ ...so naturally, I made linesieve, a Python text munging tool to split output into sections and match/sub/split with the full power of Python's re module.| death and gravity
reader, my Python feed reader library, is 5 years old; since this is a special occasion, I thought I'd share a few thoughts on the journey so far.| death and gravity
Hi there!| death and gravity
Hi there!| death and gravity
Hi there!| death and gravity
... in which you'll find out what "could not determine a constructor for the tag" PyYAML errors mean, why do they happen, and what you can do about it.| death and gravity
namedtuple has been around since forever, and over time, its convenience saw it used far outside its originally intended purpose. With dataclasses now covering part of those use cases, what should one use named tuples for? In this article, I address this question, and give a few examples from real code.| death and gravity
PEP 661 proposes adding a utility for defining sentinel values in the Python standard library. In this article, you'll get a PEP 661 summary, learn what sentinel objects are (with real-world examples), how to use them with type hints, and a bit about why PEPs exist in the first place.| death and gravity
In this article, we look at a heuristic for using classes in Python, with examples from real-world code, and some things to keep in mind.| death and gravity
This is the second article in a series about writing an SQL query builder in 150 lines of Python, why I wrote it, how I thought about it, and the decisions I had to make. In this article, I talk about why I needed a query builder in the first place, with examples derived from real use cases I had for my feed reader library.| death and gravity
... in which we look at an interesting alternative to Makefiles with .PHONY-only targets, and why I think it's cool.| death and gravity
In this article, you'll find out what Python hashlib "object supporting the buffer API required" TypeErrors mean, why do they happen, and what you can do about it.| death and gravity
On your Python learning journey, you may have heard that a great way to get better is to read code written by other people. That's true, but finding good code to study is not easy, mostly because the design philosophy and the reasoning behind the code are rarely documented. The Python standard library is special in this regard: not only is the code open source, but the discussions around the design decisions are public, too.| death and gravity
Are you having trouble making the modules work together in a larger project? Have you tried looking at popular projects as models, but were put off by their size and scope, or found it hard to see why they did the things they did? Resources about this do exist, but they're scattered all over, and might be hard to find for someone early in their programming journey.| death and gravity
... in which we solve the day 17 problem from Advent of Code 2020, Conway Cubes, in a generic way, focusing on testing, refactoring, and idiomatic Python, in a way that helps you translate those skills to your regular, non-puzzle coding.| death and gravity