Python 3.14 Is Here. How Fast Is It?

Posted by

on under

In November of 2024 I wrote a blog post titled "Is Python Really That Slow?", in which I tested several versions of Python and noted the steady progress the language has been making in terms of performance.

Today is the 8th of October 2025, just a day after the official release of Python 3.14. Let's rerun the benchmarks to find out how fast the new version of Python is!

Create a React + Flask Project in 2025

Posted by

on under

My article on creating a React + Flask project is one of the most visited on this blog. Can you believe that I wrote it over 5 years ago?

In this article and video I'm going to share how I'm building this type of project in 2025. The main change I've introduced since I documented my 2020 process is that now I'm using Vite (French word that is pronounced "veet" and means "quick") instead of create-react-app to scaffold the React application, since the latter isn't maintained anymore.

A Review of The Quick Python Book, Fourth Edition

Posted by

on under

I've been given a review copy of The Quick Python Book, Fourth Edition by Naomi Ceder, published by Manning. Since I often get asked for Python book recommendations, I thought it would be a good idea to share a review, in case you are looking for material to sharpen your Python skills.

The Quick Python Book, Fourth Edition

Dynamic Forms with Flask

Posted by

on under

A common need in web applications is to create a form that allows the user to enter a list of items, with the number of items not known in advance. This is a pattern often used when entering user information, specifically for phone numbers or addresses, but has a lot of other uses as well. In the example below you can see how the user dynamically adds more phone numbers to the form by clicking the "Add another" link.

Flask form with a dynamic list of phone numbers

Implementing this with Flask is surprisingly tricky, as it requires a combination of back and front end techniques working together. In this article I will show you two possible solutions, a basic one that uses only Flask and a more complete one for the Flask-WTF form handling extension.

Encryption at Rest with SQLAlchemy

Posted by

on under

In this tutorial I'm going to show you how to extend SQLAlchemy so that you can define database columns that are stored encrypted. In the solution I'm going to share, the columns that are designated as encrypted will transparently encrypt and decrypt themselves as data moves to and from the database.

For this tutorial I'm going to use SQLAlchemy version 2, the latest and greatest. All the techniques I will present can be adapted to SQLAlchemy 1.x if you need to work with legacy versions. If you are interested in updating your knowledge of SQLAlchemy, I have a SQLAlchemy 2 book that can help.

Is Python Really That Slow?

Posted by

on under

My standard response when someone asks me how I deal with Python being such a slow language is that Python is by far the fastest to write, cleanest, more maintainable programming language I know, and that a bit of a runtime performance penalty is a small price to pay when I'm rewarded with significant productivity gains. I rarely feel Python slows me down, and on the other side I constantly marvel at how fast I code with it compared to other languages.

This weekend I was supposed to attend PyCon Ireland, but a nasty cold is forcing me to stay home instead. Without a lot of energy to do much else, I decided to pass the time running some benchmarks to help me form a better mental image of Python's often criticized performance.

The Ultimate Guide to Error Handling in Python

Posted by

on under

I often come across developers who know the mechanics of Python error handling well, yet when I review their code I find it to be far from good. Exceptions in Python is one of those areas that have a surface layer that most people know, and a deeper, almost secret one that a lot of developers don't even know exists. If you want to test yourself on this topic, see if you can answer the following questions:

  • When should you catch exceptions raised by functions you call, and when should you not?
  • How can you know what exception classes to catch?
  • When you catch an exception, what should you do to "handle" it?
  • Why is catching all exceptions considered a bad practice, and when is it okay to do it?

Are you ready to learn the secrets of error handling in Python? Let's go!

Microdot: Yet Another Python Web Framework

Posted by

on under

I just realized that I have never written on this blog about Microdot, my very own web framework for Python. I have released Microdot 2.0 a few days ago, so I guess this is a good time to make a belated announcement, and tell you why this world needs yet another Python web framework.

But before I tell you about the reasons and the history of Microdot, let me share some of its features:

  • Flask-like syntax, but without the magical/obscure parts (no application/request contexts)
  • Small enough to work with MicroPython, while also being compatible with CPython
  • Fully compatible with asyncio
  • Websocket support
  • Server-Sent Events (SSE) support
  • Templating support with Jinja (CPython) and uTemplate (MicroPython)
  • Cross-Origin Request Sharing (CORS) support
  • User sessions stored on cryptographically signed cookies
  • Uses its own minimal web server on MicroPython, and integrates with any ASGI or WSGI web servers on CPython
  • Included test client to use in unit tests

Interested? Keep reading to learn more about Microdot.

Announcing the Flask Mega-Tutorial, 2024 Edition

Posted by

on under

Today I'm super-excited to share that I have made available a major update to the Flask Mega-Tutorial, which I'm calling the "2024 Edition".

Flask Mega-Tutorial

In the following sections I'll re-introduce the tutorial in case you have not seen it before, and I'll also go over the changes and improvements in this revised edition.

The Flask Mega-Tutorial, Part XXIII: Application Programming Interfaces (APIs)

Posted by

on under

This is the twenty third and last installment of the Flask Mega-Tutorial series, in which I'm going to tell you how to extend microblog with an application programming interface (or API) that clients can use to work with the application in a more direct way than the traditional web browser workflow.