/Python

Don't Let Dicts Spoil Your Code

- Roman Imankulov tl;dr: "The simplicity of organic code growth has a flip side: it becomes too hard to maintain. The proliferation of dicts as primary data structures is a clear signal of tech debt in your code. Fortunately, modern Python provides many viable alternatives to plain dicts."

featured in #329


The Overengineered Solution To My Pigeon Problem

- Max Nagy tl;dr: "The brains of the operation is a python script using openCV. It compares the current image to the normal background. If the average amount of change of all pixels is above some threshold, we fire the gun."

featured in #328


Python 3.11 Performance Benchmarks Are Looking Fantastic

- Michael Larabel tl;dr: "Python 3.11 is 10~60% faster than Python 3.10 according to the official figures and a 1.22x speed-up with their standard benchmark suite." Michael shows his own test results. 

featured in #323


Animating Regular Expressions With Python and Graphviz

- Aydin Schwartz tl;dr: "I find the absolute best way to understand a concept is to visualize it. I’ve built a regex engine using Python and Graphviz that animates what actually goes on when a regex is searching through a body of text. If you want to try out your own examples, the project is publicly available on GitHub."

featured in #318


PyCon US 2022 Highlights

- Eric Matthes tl;dr: "PyCon is way too big for any one person’s summary to tell the whole story, but I’m happy to share some of my personal highlights from this year’s event." Eric includes the opening ceremony and keynote, favorite talks, and more.

featured in #316


Python f-strings Are More Powerful Than You Might Think

- Martin Heinz tl;dr: "There are however some facts and handy features of f-string that you might not know about. So, let’s take a tour of some awesome f-string features that you’ll want to use in your everyday coding."

featured in #306


What To Expect From Python 3.11?

- Bas Steins tl;dr: (1) Even better error messages. (2) Adding the self type. (3) Introduction of Variadic Generics in the context of numerical libraries. (4) TOML format can be parsed with a tomllib. (5) ExceptionGroups allowing us to raise multiple exceptions simultaneously. (6) AsyncIO task groups. (7) Performance improvements.

featured in #304


Upcoming Python Features Brought To You By Python Enhancement Proposals

- Martin Heinz tl;dr: In this article we will go over all the proposals that are going to bring some exciting new Python features. Martin covers the coming syntax changes, type annotations, debugging, and "quality of life" changes, adding support for parsing TOML format to Python's standard library.

featured in #295


When I'm Sad My Computer Sends Me Cats

- Andrew Healey tl;dr: "I split the emotions into good vs. bad to get a clearer read of my mood. The overall score swings between -1 (very bad) and 1 (very good). I don't want to be spammed with cats every time I itch my nose and trigger a frame of video that's interpreted as negative so I added a three-second trailing average to look for prolonged periods of negative emotion."

featured in #294


How We Optimized Python API Server Code 100x

- Vadim Markovtsev tl;dr: "Some of the tricks we used to speed up calls to our analytical API written in Python: played with asyncio, messed with SQLAlchemy, hacked deep in asyncpg, rewrote parts in Cython, found better data structures, replaced some pandas with pure numpy."

featured in #291