Optimize your Python Program for Slowness, Mutable default arguments and more
with some more interesting news, articles, packages and projects
News
PEP 750 – Template Strings accepted
Wikipedia is giving AI developers its data to fend off bot scrapers
If you're planning to crawl Wikipedia for AI training, you might want to skip the hassle - Wikipedia has released dataset on Kaggle that's specifically optimised for training AI models.
Apache Airflow 3.0 is out!
Articles
How to Optimize your Python Program for Slowness
We all aim to make our programs faster, but have you ever tried doing the opposite? I mean, intentionally making them slower. Understanding how to write painfully slow code can actually help you recognise performance pitfalls. In this article, Carl Kadie demonstrated how a simple nested loop can create a program that runs longer than the lifetime of the universe. He dove into concepts like tetration (yes, it goes beyond exponentiation), 5-State Turing Machines and how Python’s int
type can drastically affect performance.
# Carl Kadie
This course by Vuk Rosić gives a complete deep dive into DeepSeek V3, a state-of-the-art deep learning model. He covered theoretical explanations with step-by-step coding instructions to make things easier to understand and implement the model from scratch.
# Vuk Rosić
An Introduction to Testing in Python Flask
Writing tests is one of the best ways to ensure code quality, streamline development and boost confidence when making changes. If you're looking to learn how to write tests for your Flask application, check out this article by Federico Trotta. He walked through everything from writing basic tests to mocking external services, It’s a great resource for levelling up your Flask testing skills.
# Federico Trotta
Mutable default arguments
Default values in function arguments are super handy, but using mutable objects (like lists or dictionaries) as defaults can cause unexpected behaviour, because they’re shared across calls. Even beyond mutables, shared default values can lead to bugs. If you still want to use them safely, check out this article by Trey Hunner. He explained them with clear examples and offered practical solutions.
# Trey Hunner
Building Transformers from Scratch
Transformers are at the core of all modern LLMs. Understanding how they work can deepen your grasp of these powerful models. If you're curious to learn more, check out this article by Stephen Diehl. He walked through building transformers from scratch and explained the concepts in a hands-on, approachable way.
# Stephen Diehl
Interesting Packages and Projects to Explore
Python-Blosc2 - A fast & compressed ndarray library with a flexible compute engine.
PipeFunc - A Python library for defining, managing, and executing function pipelines.
Narwhals - Extremely lightweight compatibility layer between dataframe libraries
pytest-testmon - selects tests affected by changed files and methods
Patito - A dataframe modelling library built on top of polars and pydantic.
About Upcoming Python Events
PyLadies Amsterdam: Open source, open pipelines: Data ingestion with modern data stack
April 29, 2025
PyCamp España 2025
May 1 – 4, 2025
🐍 Canberra Python Meetup - Use Python as your shell with Xonsh by Leo Broska
May 1, 2025
Michigan Python May Meeting
May 1, 2025