skip to navigation
skip to content

Planet Python

Last update: March 15, 2025 04:43 AM UTC

March 14, 2025


TestDriven.io

Django Query Optimization - Defer, Only, and Exclude

In this article, we'll look at the differences between Django QuerySet's defer, only, and exclude methods.

March 14, 2025 10:28 PM UTC


Robin Wilson

My talk at FOSS4G UK South West 2024

As always, this post is very delayed – apologies. In fact, I was encouraged to write this by a friend who I see at PyData Southampton (Hi, if you’re reading this!). I mentioned my talk in passing to her, and she asked if I’d blogged about it yet. I admitted that I hadn’t, and promised I would by the next PyData Southampton. Well, I totally failed at that – but there is another PyData Southampton meetup on Tuesday, so I’m going to get it done in time for that.

The FOSS4G UK South West conference 2024 took place in Bristol on 12th November. I gave a talk there entitled Using cloud-native geospatial technologies to build a web app for analysing and reducing flood risk, talking about some of the work I’ve done with the company I’m currently working with: Rebalance Earth.

The talk covers the development of a web app for looking at assets (businesses, buildings, substations etc) that are at risk from flooding in the UK, and comparing various flood scenarios to understand how risk could be reduced by Natural Flood Management strategies such as river restoration. After introducing Rebalance Earth and the web app itself, I talk about the technologies behind it and the ‘cloud native’ manner in which it was designed. I specifically cover generating Mapbox Vector Tiles on-the-fly from a PostGIS database, and generating raster tiles on-the-fly from COG files stored in cloud storage.

Full slides are available here. There is also a video recording of the talk available, but it’s a bit hard to watch as you can’t see the slides on the video.

Once you’ve had a look at my talk, don’t forget to check out the other talks that were given at the conference, they were great!

March 14, 2025 08:41 PM UTC


Python Insider

Python 3.14.0 alpha 6 is out

Here comes the penultimate alpha.

https://www.python.org/downloads/release/python-3140a6/

This is an early developer preview of Python 3.14

Major new features of the 3.14 series, compared to 3.13

Python 3.14 is still in development. This release, 3.14.0a6, is the sixth of seven planned alpha releases.

Alpha releases are intended to make it easier to test the current state of new features and bug fixes and to test the release process.

During the alpha phase, features may be added up until the start of the beta phase (2025-05-06) and, if necessary, may be modified or deleted up until the release candidate phase (2025-07-22). Please keep in mind that this is a preview release and its use is not recommended for production environments.

Many new features for Python 3.14 are still being planned and written. Among the new major new features and changes so far:

The next pre-release of Python 3.14 will be the final alpha, 3.14.0a7, currently scheduled for 2025-04-08.

More resources

And now for something completely different

March 14 is celebrated as pi day, because 3.14 is an approximation of π. The day is observed by eating pies (savoury and/or sweet) and celebrating π. The first pi day was organised by physicist and tinkerer Larry Shaw of the San Francisco Exploratorium in 1988. It is also the International Day of Mathematics and Albert Einstein’s birthday. Let’s all eat some pie, recite some π, install and test some py, and wish a happy birthday to Albert, Loren and all the other pi day children!

Enjoy the new release

Thanks to all of the many volunteers who help make Python Development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organisation contributions to the Python Software Foundation.

Regards from Helsinki as fresh snow falls,

Your release team,
Hugo van Kemenade @hugovk
Ned Deily @nad
Steve Dower @steve.dower
Łukasz Langa @ambv

March 14, 2025 01:27 PM UTC


Real Python

The Real Python Podcast – Episode #243: Manage Projects With pyproject.toml & Explore Polars LazyFrames

How can you simplify the management of your Python projects with one file? What are the advantages of using LazyFrames in Polars? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder's Weekly articles and projects.


[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

March 14, 2025 12:00 PM UTC


Django Weblog

DSF member of the month - Cory Zue

For March 2025, we welcome Cory Zue (@coryzue.com) as our DSF member of the month! ⭐

Cory Zue is a Django developer for many years. He is currently a member of the DSF Social Media Working Group and he has been a DSF member since octobre 2022.
You can learn more about Cory by checking out his website or visiting Cory's GitHub Profile.

Let’s spend some time getting to know Cory better!

Can you tell us a little about yourself (hobbies, education, etc)

I'm a programmer-turned-manager-turned-entrepreneur and currently run a portfolio of businesses on my own (using Django of course!).

I grew up in Massachusetts and studied Computer Science at MIT where I met the founders of Dimagi, where I ended up as CTO for 10 years before starting my own businesses. In 2016, I moved to Cape Town, South Africa for a "temporary" relocation, and have been here ever since. These days my main hobbies include surfing, trail running, and exploring nature with my wife and two boys.

How did you start using Django?

My first major Django project was working on an SMS-based system that helped with the distribution of millions of bednets in Nigeria. It was built on top of a Django-based platform called RapidSMS that was initially developed by UNICEF. After that I worked on several other RapidSMS systems before eventually leading Dimagi's CommCare server team. CommCare eventually became -- to my knowledge -- the largest open source Django codebase in terms of contributions/commits.

What other framework do you know and if there is anything you would like to have in Django if you had magical powers?

I still love Django and use it for most projects that need a backend. That said, I find Django's "hands off" approach to modern front end development to be a big barrier for people who aren't already familiar with the framework.

If I had magical powers I would convince the Django community that it is worth providing some out-of-the-box support for modern front end tooling like TailwindCSS or a JavaScript bundler. I'd also try to get official "starter projects" built into the framework that show how you can use Django with some of the more popular front end options like React and HTMX.

What projects are you working on now?

My main project right now is SaaS Pegasus, which is a Django codebase creator that helps you spin up new projects more efficiently by bundling in even more batteries than Django itself. This includes things like configuring auth, front end, and deployment, but also has some more powerful features like multi-tenancy and billing baked in.

One of the great things about running Pegasus is that I can justify building new Django apps as dogfooding the product. So I always have other Django projects I'm working on. Right now the biggest one is a RAG chat-with-your-data LLM project called Scriv.ai.

Within the Django community my main contributions are in the form of writing in-depth guides to using Django, as well as pitching in on the Social Media working group to help grow Django's audience.

Which Django libraries are your favorite (core or 3rd party)?

It's hard to go with anything other than the ORM (and migrations framework), which I still feel is Django's greatest and most important feature. It just fits my brain much better than SQLAlchemy or other options I've used.

One lesser-known library I'll shout out that I have been enjoying lately is django-cotton, which provides a nice little layer of syntactic sugar and tooling that makes working with components in Django templates much nicer.

What are the top three things in Django that you like?

  1. The ORM + migrations.

  2. The community.

  3. That nearly every backend use case I have already has a feature that's been built to accommodate it (e.g. middleware, messages, i18n, etc.). I feel like the modern JavaScript frameworks I've used are way behind on this front.

What would you recommend to someone who wants to start out as an entrepreneur like you?

I have an entire talk/article about this!

But if I were to emphasize the most important part that worked for me, it was creating enough space in my life for deep, uninterrupted work and structuring it in a way that I never ran out of money or energy while I was trying (by working part time while I was getting started). In general, the path to success usually takes a long time, so giving yourself plenty of time is really important. The tactics you can figure out as you go, but the space and time to do it is the most important thing to have in place. Your main goal is not to quit.

Is there anything else you'd like to say?

Thank you for including me in this series!


Thank you for doing the interview, Cory!

March 14, 2025 11:53 AM UTC


Talk Python to Me

#496: Scaf: Complete blueprint for new Python Kubernetes projects

Today we explore the wild world of Python deployment with my friend, Calvin Hendricks-Parker from Six Feet Up. We’ll tackle some of the biggest challenges in taking a Python app from “it works on my machine” to production, covering inconsistent environments, conflicting dependencies, and sneaky security pitfalls. Along the way, Calvin shares how containerization with Docker and Kubernetes can both simplify and complicate deployments, especially for smaller teams. Finally, we’ll introduce Scaf, a powerful project blueprint designed to give developers a rock-solid start on Python web projects of all sizes. <br/> <br/> Get notified when the <a href="https://talkpython.fm/books/python-in-production"><em>Talk Python in Production</em> book</a> goes live and <a href="https://talkpython.fm/books/python-in-production">read the first third online</a> right now.<br/> <br/> <strong>Episode sponsors</strong><br/> <br/> <a href='https://talkpython.fm/connect'>Posit</a><br> <a href='https://talkpython.fm/devopsbook'>Python in Production</a><br> <a href='https://talkpython.fm/training'>Talk Python Courses</a><br/> <br/> <h2 class="links-heading">Links from the show</h2> <div><strong>Calvin Hendryx-Parker</strong>: <a href="https://github.com/calvinhp?featured_on=talkpython" target="_blank" >github.com</a><br/> <strong>Scaf on GitHub</strong>: <a href="https://github.com/sixfeetup/scaf?featured_on=talkpython" target="_blank" >github.com</a><br/> <strong>Scaf on GitHub (duplicate)</strong>: <a href="https://github.com/sixfeetup/scaf?featured_on=talkpython" target="_blank" >github.com</a><br/> <br/> <strong>"Deploy the Dream" song</strong>: <a href="https://blobs.talkpython.fm/deploy-the-dream-talk-python.mp3" target="_blank" >deploy-the-dream-talk-python.mp3</a><br/> <br/> <strong>CloudDevEngineering YouTube Channel</strong>: <a href="https://www.youtube.com/@CloudDevEngineering" target="_blank" >youtube.com</a><br/> <strong>TechWorld with Nana YouTube Channel</strong>: <a href="https://www.youtube.com/@TechWorldwithNana" target="_blank" >youtube.com</a><br/> <strong>Tilt (Kubernetes Dev Tool)</strong>: <a href="https://tilt.dev/?featured_on=talkpython" target="_blank" >tilt.dev</a><br/> <strong>Talos (Minimal OS for Kubernetes)</strong>: <a href="https://www.talos.dev/?featured_on=talkpython" target="_blank" >talos.dev</a><br/> <strong>Traefik Reverse Proxy</strong>: <a href="https://traefik.io/traefik/?featured_on=talkpython" target="_blank" >traefik.io</a><br/> <strong>Sealed Secrets on GitHub</strong>: <a href="https://github.com/bitnami-labs/sealed-secrets?featured_on=talkpython" target="_blank" >github.com</a><br/> <strong>Argo CD Documentation</strong>: <a href="https://argo-cd.readthedocs.io/en/stable/?featured_on=talkpython" target="_blank" >readthedocs.io</a><br/> <strong>MailHog on GitHub</strong>: <a href="https://github.com/mailhog/MailHog?featured_on=talkpython" target="_blank" >github.com</a><br/> <strong>Next.js</strong>: <a href="https://nextjs.org/?featured_on=talkpython" target="_blank" >nextjs.org</a><br/> <strong>Cloud Custodian</strong>: <a href="https://cloudcustodian.io/?featured_on=talkpython" target="_blank" >cloudcustodian.io</a><br/> <strong>Valky (Redis Replacement)</strong>: <a href="https://valkey.io/?featured_on=talkpython" target="_blank" >valkey.io</a><br/> <strong>“The ‘Works on My Machine’ Certification Program” (Coding Horror)</strong>: <a href="https://blog.codinghorror.com/the-works-on-my-machine-certification-program/?featured_on=talkpython" target="_blank" >blog.codinghorror.com</a><br/> <strong>NVIDIA’s First Desktop AI PC (Ars Technica)</strong>: <a href="https://arstechnica.com/ai/2025/01/nvidias-first-desktop-pc-can-run-local-ai-models-for-3000/?featured_on=talkpython" target="_blank" >arstechnica.com</a><br/> <strong>Kind (Kubernetes in Docker)</strong>: <a href="https://kind.sigs.k8s.io/?featured_on=talkpython" target="_blank" >kind.sigs.k8s.io</a><br/> <br/> <strong>Updated Effective PyCharm Course</strong>: <a href="https://training.talkpython.fm/courses/explore_pycharm/mastering-pycharm-ide" target="_blank" >training.talkpython.fm</a><br/> <strong>Talk Python in Production book</strong>: <a href="https://talkpython.fm/books/python-in-production" target="_blank" >talkpython.fm/books/python-in-production</a><br/> <strong>Watch this episode on YouTube</strong>: <a href="https://www.youtube.com/watch?v=-GWj3hKnGOM" target="_blank" >youtube.com</a><br/> <strong>Episode transcripts</strong>: <a href="https://talkpython.fm/episodes/transcript/496/scaf-complete-blueprint-for-new-python-kubernetes-projects" target="_blank" >talkpython.fm</a><br/> <br/> <strong>--- Stay in touch with us ---</strong><br/> <strong>Subscribe to Talk Python on YouTube</strong>: <a href="https://talkpython.fm/youtube" target="_blank" >youtube.com</a><br/> <strong>Talk Python on Bluesky</strong>: <a href="https://bsky.app/profile/talkpython.fm" target="_blank" >@talkpython.fm at bsky.app</a><br/> <strong>Talk Python on Mastodon</strong>: <a href="https://fosstodon.org/web/@talkpython" target="_blank" ><i class="fa-brands fa-mastodon"></i>talkpython</a><br/> <strong>Michael on Bluesky</strong>: <a href="https://bsky.app/profile/mkennedy.codes?featured_on=talkpython" target="_blank" >@mkennedy.codes at bsky.app</a><br/> <strong>Michael on Mastodon</strong>: <a href="https://fosstodon.org/web/@mkennedy" target="_blank" ><i class="fa-brands fa-mastodon"></i>mkennedy</a><br/></div>

March 14, 2025 08:00 AM UTC


Seth Michael Larson

Fediverse Donut Club (#FediDonutFriday)

At a past job there was an employee-run "donut club" where members would rotate every week bringing in donuts for everyone else. By the time that I joined this club there was over 30 people meaning almost everyone on the team was bringing in donuts once or twice a year.

When it was your turn to bring donuts you got to "host" the boxes of donuts in your cubicle meaning everyone in the donut club came to you, said hello, introduced themselves, and all that.

I didn't know it at the time, but donut club was an amazing tool for socializing and organizing. We were enjoying our donuts, but we were also strengthening our bonds with coworkers. Some of the people I met in donut club I'm still good friends with. Like all good friends we sometimes discuss labor conditions and help each other with job hunting, negotiating, and being paid fairly.

Why make a donut club in the Fediverse?

I propose the creation of a "Fediverse Donut Club" with an every-other-week #FediDonutFriday event where everyone in Fediverse Donut Club procures and shares pictures of donuts to meet others in the Fediverse.

I'm interested in how we can make online communities more "horizontal" like the real world, where people aren't divided only by their hyper-specific interests and bubbles. This is an experiment to see if a few posts in the Fediverse can get you out in your local community bakery for an occasional donut and connecting with others online.

Seems like a good deal to me! 🍩

How to join Fediverse Donut Club

If you're not sure whether your post will be discoverable (due to your instance being small, for example) you can direct message me on Mastodon with the hashtag.

When is the next #FediDonutFriday?

#FediDonutFriday is every two weeks starting Friday, March 14th 2025. I created the below QR code to add a reminder to any calendar.

Note there's no "responding yes", tracking, or surveillance in this ICS file, it's a simple recurring event. You can also import the ICS file manually if you'd like.

March 14, 2025 12:00 AM UTC

March 13, 2025


Python Morsels

Alternatives to Python's "break" statement

Python's break statement is handy for breaking out of a loop. But break statements can often be replaced by a more readable looping helper function.

Table of contents

  1. Using a containment check instead
  2. Checking whether some/every item matches a condition
  3. Finding the first matching value
  4. Collecting items until a condition is met
  5. Consider break statement alternatives

Using a containment check instead

Python's break statement is often used when you need an early break condition, that is a condition which would indicate that you don't need to loop any further because you've found what you're looking for.

For example here's a loop that checks for a specific value and then breaks:

color_options = ["blue", "green", "purple"]

is_purple_an_option = False
for color in color_options:
    if color == "purple":
        is_purple_an_option = True
        break

That for loop checks whether our iterable contains a certain value at least once. If it does, we flip a boolean variable from False to True.

Instead of using that for loop, we could use Python's in operator on our iterable:

color_options = ["blue", "green", "purple"]

is_purple_an_option = "purple" in color_options

All iterables support the in operator and in fact on some iterables (e.g. sets and dictionaries) it's even faster than looping (see list containment checks).

Checking whether some/every item matches a condition

What if we're checking for …

Read the full article: https://www.pythonmorsels.com/break-statement-alternatives/

March 13, 2025 04:05 PM UTC


Django Weblog

Accessibility and inclusivity at FOSDEM 2025

For this year’s FOSDEM conference, our Django accessibility team organized the "Inclusive Web" track. Here’s a recap of how it went!

The idea for the Inclusive Web devroom started at FOSDEM 2024, where we discussed the importance of showcasing accessibility and inclusivity work in open source, in web development and beyond. The Django accessibility team got to work on a FOSDEM 2025 proposal. Lo and behold, it got accepted, and here we are with a room full of people interested in those topics, and a great lineup of speakers!

Panorama of the room during a talk, taken from the back. It’s a classroom with multiple rows of tables and seats. Some people are standing on the side. The speaker is in front of their slides at the front of the room.

The room was full for most of the day with about 70 attendees, with the conference also providing a livestream for remote participants. We had a great mix of talks, covering a lot of the aspects of the Inclusive Web that we wanted to showcase.

The talks

Top Accessibility Errors Found in Open Source Through Automated Testing

In the first talk of the day, Raashi Saxena shares insights on the most common accessibility errors in open-source projects, based on manual and automated testing. She highlights real-world case studies to help developers improve accessibility in their projects – and warn against the legal risks of poor accessibility!

Raashi getting the devroom started

Solving the world’s (localization) problems

Eemeli Aro and Ujjwal Sharma introduce MessageFormat 2, a new standard to address long-standing localization challenges. They discuss its potential applications and the tools being built around it. This standard is very promising for Django developers working on multilingual applications to provide better translations for users, and better capabilities for translators.

Eemeli and Ujjwal introduce themselves

Alternative Text for Images: How Bad Are Our Alt-Text Anyway?

Mike Gifford explores the importance of alt text in web accessibility and how often it misses the mark. He demonstrates his alt text scan Python script for auditing alt-text across websites. Alt text is a common issue on Django projects, and the AI generation showcased by Mike has the potential to move the needle.

Mike shares his experiments

Secure and Inclusive: WebAuthn for (Multi-Factor) Authentication

Storm Heg explains how WebAuthn (Passkeys) offers a secure and user-friendly alternative to traditional authentication methods. This talk covers how it works, its accessibility benefits, and how Django developers can integrate it into their projects. Storm showcases his django-otp-webauthn package and other alternatives.

Storm’s whoami output

How do we work out the environmental savings from accessibility?

Chris Adams discusses how supporting older devices through accessible digital services can reduce e-waste. He explores research on hardware obsolescence, data-driven methods for measuring environmental impact, and policy changes in digital sustainability. This builds upon previous work by Chris showcasing the parallels between web accessibility and sustainability.

Chris with his cover slide

Growing inclusive communities: Djangonaut Space program

Raffaella Suardini shares the success of the Djangonaut Space mentorship program in fostering sustainable contributions and welcoming new contributors. She provides strategies for building inclusive tech communities, which are crucial to the success of open-source projects like Django 💜.

Raffaella taking questions

Multilingual Speech Technologies That Understand You

Jessica Rose discusses how Common Voice’s crowdsourced speech dataset helps developers build speech technologies for underrepresented languages. She highlights the challenges of linguistic diversity in tech – which are very relevant for a project with such an international and multiligual user base as Django.

Jessica showcases project challenges

ATAG accessibility audits: worth your while

Thibaud Colas introduces the Authoring Tool Accessibility Guidelines (ATAG) and explains why they are essential for content creation tools, like the Django admin. He shares highlights of where projects can learn a lot from ATAG, making this talk valuable for Django developers working with content publishing.

Thibaud lists accessibility standards

All recordings

You can watch them all on the FOSDEM website:

Raashi to the side of her slides, titled 'Accessibility', with examples of what accessibility means Raashi Saxena - Top Accessibility Errors Found in Open Source Through Automated Testing | FOSDEM 2025 Eemeli and Ujjwal in front of Ujjwal’s introduction slide, with audience members in the foreground Eemeli Aro and Ujjwal Sharm - Solving the world’s (localization) problems | FOSDEM 2025 Mike to the right of his slides, titled 'Initial experiment with proprietary tools', with attendees in the foreground Mike Gifford - Alternative Text for Images: How Bad Are Our Alt-Text Anyway? | FOSDEM 2025 Storm in front of his slides, with audience members in the foreground Storm Heg - Secure and Inclusive: WebAuthn for (Multi-Factor) Authentication | FOSDEM 2025 Chris is to the right of his slide, titled 'How do we work out the environmental savings from accessibility?' Chris Adams - How do we work out the environmental savings from accessibility? | FOSDEM 2025 Raffaella in front of a slide titled 'Thank you' Raffaella Suardini - Growing inclusive communities: Djangonaut Space program | FOSDEM 2025 Jessica in front of a slide titled 'Why are these problems?' Jessica Rose - Multilingual Speech Technologies That Understand You | FOSDEM 2025 Thibaud in a pineapple hoodie in front of his slides Thibaud Colas - ATAG accessibility audits: worth your while | FOSDEM 2025

See you in 2026

We had a blast running this devroom, and we’re looking forward to doing it again in 2026 if we get the chance! Thank you to our speakers, devroom organizers (Saptak, Tom, Sarah, Thibaud, Eli), and helpers (Alex and Storm) for making this event a success! 🎉

Collage of Inclusive Web devroom organizers, helpers, and speakers. With three separate pictures of people smiling, in different areas of the conference venue. Top: Raffaella, Sarah, Thibaud, Alex. Then Saptak, Storm, Sarah, Thibaud. Then at the bottom Storm, Thibaud, Sarah, Alex. Our 2025 devroom speakers, organizers, and helpers. Top left to right: Raffaella, Sarah, Thibaud, Alex, Saptak, Storm

March 13, 2025 02:00 PM UTC


Reuven Lerner

My newest course: HOPPy (Hands-on Projects in Python)

Congratulations! You’ve finished a Python course, or even two. You’re now a certified Python programmer.

And yet, when it comes time to start a new Python project, you aren’t sure where to start. The blank screen in front of you doesn’t fill you with excitement and creativity. Rather, it fills you with self-doubt and dread.

It’s even worse, of course, if the project is part of your job.

You’re not alone in feeling this way. That’s largely because real-world Python projects go far beyond what you’ll learn in a typical class:

I constantly encounter people who know the basics of the language, but are frustrated when it comes time to create, manage, and distribute their own project. This has become especially acute over the last few years, as the set of Python tools has become more modern and robust — but also more complex.

How can you improve your skills, and get over these feelings of frustration and doubt?

You could write a toy project. But you’re likely to be more invested in, and thus learn from, a small, real-world project that you choose, and that is meaningful to you.

You could learn on your own. Yes, you could. But why should you make the same mistakes that I and many others have made, when we can help you to avoid them? And besides, learning with others always helps to clarify things.

You could decide to learn over time, little by little. That’s fine, but there are a dozen or so tools and techniques to learn, and there’s limited time in the day. And each of them will save you time, energy, and frustration down the road.

HOPPy, Hands-On Projects in Python

HOPPy is a live, collaborative, six-week course that will give you the knowledge and confidence you need to create and distribute maintainable software projects using Python. I plan to run a new cohort of HOPPy every few months, each with a different focus.

The first cohort, which starts on March 30th, will concentrate on writing a library distributed on PyPI.

Here’s how HOPPy works:

The goal? To learn, together, how to create a modern Python project, one that is meaningful to you, and will thus keep you motivated to continue. 

By the end of this course, you won’t feel embarrassed or nervous about a new project’s blank screen. Rather, you’ll be excited to dig in and start creating something amazing. And when you start a new Python-related job? You’ll know what to do, and will be able to hit the ground running.

Schedule for HOPPy 1

The first HOPPy cohort will begin on Sunday, March 30th, and will meet six times.

The theme for this cohort will be: Distributing a library on PyPI. You’ll create a module containing one or more functions that do something awesome (for some definition of “awesome”). People will be able to `pip install` your package and then use it on their own systems.

At the end of the six-week class, you will have a project on PyPI – one that reflects your personal interests, and which you created from scratch.

Each HOPPy meeting will be two hours long, and will take place on Zoom. (All sessions will be recorded, but I hope that you’ll be able to attend most of them.)

Sunday, March 30th: Kickoff

Sunday, April 6th: Modern packaging tools

Monday, April 14th: Adding tests

Monday, April 21st: Type checking

Sunday, April 27th: Publishing to PyPI

Sunday, May 4th: Demo day

Is HOPPy right for you?

HOPPy assumes that you are comfortable (but not necessarily fluent) with basic Python data structures, as well as writing functions, modules, and objects. (If the cohort’s topic is data analysis, then you’ll be expected to know about Pandas, as well.)

If you’ve been looking to sink your teeth into a larger project, one that’ll give you experience that can help you to find a new job or just advance in your current one, then HOPPy might well be for you.

Who can join?

I plan to run 3-5 HOPPy cohorts each year. Each will have a different theme, meaning that you can participate in more than one cohort, learning different skills from each one.

I’m capping the number of participants at 25.

Participation is only open to subscribers to one of my LernerPython membership programs, either the base LernerPython subscription (for Python and Git) or the Python+Data level (which includes data-analysis topics and exercises). Each HOPPy cohort costs $750 fee, beyond your usual subscription payment.

Current participants in PythonDAB (my twice-a-year Python data-analysis bootcamp) can participate in HOPPy without any additional charge.

Upon completion of the course, you’ll get a certificate/letter from me, indicating your completion.

What if I don’t have an idea?

The first brainstorming session is for coming up with an idea – and if you can’t come up with anything, I’ll be there to help and suggest things!

I’ll also be there to make sure that you don’t bite off more than you can chew, making plans that you won’t be able to accomplish during our six-week cohort.

Who am I?

I’m Reuven, a full-time instructor in Python, Pandas, and Git. I work with companies around the world, helping to train their engineers. But I also teach individuals who want to improve their skills, via my https://LernerPython.com platform.

People rave about my courses, and how they clarify topics that were previously hard to understand. But people also enjoy the fact that I give people personal attention, reviewing their code and helping them to improve their skills. 

Here are some statements from people who took my courses over the last few months:

If you put in the work, then after six weeks you’ll have a simple – but real and working – project published on PyPI. And you’ll know how to do it for more projects, too.

Want to level up your Python skills?

Sign up for a free webinar to learn more about HOPPy, how it works, and what you’ll learn.

Or if you’re already sure that HOPPy is for you, then e-mail me at reuven@lerner.co.il (or DM me on the LernerPython Discord server) to get the signup link.

Questions? 

Send questions my way via e-mail, at reuven@lerner.co.il.

The post My newest course: HOPPy (Hands-on Projects in Python) appeared first on Reuven Lerner.

March 13, 2025 01:54 PM UTC


TechBeamers Python

Python Increment and Decrement Operations – A Comprehensive Guide

Python provides multiple ways to increment and decrement values, which are commonly used for: ✅ Controlling iteration within loops✅ Managing counters in simulations or data processing✅ Adjusting values dynamically in mathematical computations Unlike languages like C or Java, Python does not support x++ or x– operators. Instead, it encourages an explicit and readable approach using […]

Source

March 13, 2025 06:44 AM UTC

Enforcing Unsigned Integers in Python: A Complete Guide

Python does not have built-in unsigned integers, unlike C, C++, or Java. This can create problems when:✔ You need strictly non-negative values✔ You are porting code from C/C++✔ You work with binary data, memory buffers, or numerical computing Since Python’s int can store negative values and doesn’t have a fixed bit-width, we must manually enforce […]

Source

March 13, 2025 03:41 AM UTC

March 12, 2025


Mirek Długosz

Django: data modified in pre_save signal is not saved

When I was working on my first Django project, I encountered a problem where modifications done inside pre_save signal were not stored in the database. Back then it took me a couple of hours to figure out what is wrong and how to fix it. I’m sharing what I’ve learned to save that time someone else.

Imagine the application to track your gym workouts. At the core of application is exercise session, which knows how many repetitions you want to do and how many you have done so far. Once you do enough repetitions, session is considered complete. It could be implemented like that:

class ExerciseSession(models.Model):
    target_repetitions = models.IntegerField(null=False, blank=False)
    repetitions = models.IntegerField(null=False, blank=False, default=0)
    completed = models.BooleanField(null=False, blank=False, default=False)

Since “session is complete once you do enough repetitions” is a hard rule, it needs to be enforced. pre_save signal sounds like reasonable place to implement it, as it allows us to have many functions that modify repetitions. Signal handler might look like that:

@receiver(pre_save, sender=models.ExerciseSession)
def exercise_session_pre_save(sender, instance, raw, using, update_fields, **kwargs):
    if instance.repetitions >= instance.target_repetitions:
        instance.completed = True

With the above setup we can modify the model instance and rest assured that exercise session is marked as completed when needed:

exercise_session.repetitions = 10
exercise_session.save(update_fields=["repetitions"])

Except that… this doesn’t work. Once you retrieve this exercise session from database, completed will be set to False.

The reason for this is at intersection of pre_save signal and update_fields argument. pre_save is called early in save() call and may be used to modify the instance before data is saved in database. However, SQL query constructed later in save() call will contain only the fields listed in update_fields argument.

So when calling a save(), you need to predict that pre_save signal might modify the instance, and include possibly modified fields in update_fields list:

exercise_session.save(update_fields=["repetitions", "completed"])

The complete code used in this blog post is available in GitHub repository. See the README file for instructions how to set up and run the project.

March 12, 2025 06:09 PM UTC


Python Engineering at Microsoft

New Python Driver for SQL Server and Azure SQL!

We’re thrilled to announce the alpha release of our new open-source Python driver for Microsoft SQL Server and the Azure SQL family, now available on GitHub: mssql-python.

Built from the ground up, this driver offers Python developers a robust, efficient, and fully open-source solution for connecting to SQL Server and Azure SQL. Whether you’re building data-driven applications, automating workflows, or leveraging advanced analytics, mssql-python is designed to provide a seamless and high-performance experience.

For more details, check-out our announcement blog post: https://lnkd.in/gRWsszby.

This is just the beginning—we’re excited to build this driver together with the community and would love your feedback!

Documentation | Release Notes | Roadmap

Join us in shaping the future of Python connectivity with SQL Server!

The post New Python Driver for SQL Server and Azure SQL! appeared first on Microsoft for Python Developers Blog.

March 12, 2025 04:23 PM UTC


Real Python

Python Textual: Build Beautiful UIs in the Terminal

Have you ever wanted to create an app with an appealing interface that works in the command line? Welcome to Textual, a Python toolkit and framework for creating beautiful, functional text-based user interface (TUI) applications. The Textual library provides a powerful and flexible framework for building TUIs. It offers a variety of features that allow you to create interactive and engaging console applications.

In this tutorial, you’ll learn how to create, style, and enhance Textual apps with layouts, events, and actions.

By the end of this tutorial, you’ll understand that:

  • Python Textual is a framework for building terminal-based applications with interactive and visually appealing text interfaces.
  • Textual works by providing a set of widgets, layouts, and styling options, enabling you to create responsive and interactive console apps.
  • Textual is useful for building efficient, platform-independent text-based user interfaces that work over remote connections and in low-resource environments.

Textual is built on Rich, a Python library for creating rich text and beautifully formatted terminal output. It enhances text-based applications by applying colors, styles, and formatting to your text output in Python.

Get Your Code: Click here to download the free sample code that shows you how to use Python Textual to Build Beautiful UIs in the Terminal.

Take the Quiz: Test your knowledge with our interactive “Python Textual: Build Beautiful UIs in the Terminal” quiz. You’ll receive a score upon completion to help you track your learning progress:


Interactive Quiz

Python Textual: Build Beautiful UIs in the Terminal

In this quiz, you'll test your understanding of the Python Textual library. This library is used to create rich terminal applications and widgets. By working through this quiz, you'll reinforce your knowledge of Textual's key concepts and features.

Installing Textual

Textual requires Python 3.8 or later to work. As with any new Python project, it’s a good idea to create a virtual environment before you start. This helps keep your system’s Python environment clean and prevents unnecessary dependencies that may cause trouble later on.

Note: To learn more about Python virtual environments, check out Python Virtual Environments: A Primer.

Once you have the Python virtual environment, you can install Textual from PyPI using pip, which is the package installer for Python.

Note: To learn more about pip, check out Using Python’s pip to Manage Your Projects’ Dependencies.

Open a command-line console and create a directory to host your Textual code. Then, run the commands below to create a virtual environment, activate it, and install Textual:

Windows PowerShell
PS> python -m venv venv
PS> venv\Scripts\activate
(venv) PS> python -m pip install textual textual-dev
Copied!
Shell
$ python -m venv venv
$ source venv/bin/activate
(venv) $ python -m pip install textual textual-dev
Copied!

Here, you first create a virtual environment using the venv module from the standard library. Then, you activate it, and finally, you install Textual using pip.

You’ve installed two packages:

  1. textual is the library and application framework that’ll provide the machinery for your TUI applications.
  2. textual-dev contains a command-line tool, also named textual, that facilitates debugging and interactive development through the Textual console.

In what follows, you’ll mostly be using the textual library, but you’ll also see an example of how to use the textual tool from textual-dev.

Checking the Textual Installation

The textual package is now installed in your Python virtual environment. You can check your installation by running the following command:

Shell
(venv) $ python -m textual
Copied!

You should see the Textual demo app, a nicely formatted TUI application that displays useful information about Textual’s capabilities. You can interact with it using the mouse or keys:

Notice the colored text, emojis, structured layout, and the keyboard shortcuts listed in the window footer. There’s a lot to explore here, but for now, you’re going to dive right in and create your first app using Textual. You can close the demo by pressing Ctrl+C.

Read the full article at https://realpython.com/python-textual/ »


[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

March 12, 2025 02:00 PM UTC


Python Software Foundation

PSF Distinguished Service Award Granted to Thomas Wouters

Thomas Wouters, a longtime member of the PSF Board, has been recognized with the PSF’s Distinguished Service Award. Over the last 25 years, Thomas has been a steady, welcoming presence in the Python community, serving in countless critical roles—often behind the scenes.

Thomas has served three separate terms on the PSF Board (2001–2004, 2017–2019, and 2020–2023), including his final year as Board Chair. He even stepped in as General Manager for six months, leading our staff during the search for a new Executive Director. On top of that, he served five years on the Steering Council, helping guide key technical decisions for Python itself, and is the Release Manager for both Python 3.12 and 3.13.

The PSF’s Distinguished Service Award (DSA) is granted to individuals who make sustained exemplary contributions to the Python community. Each award is voted on by the PSF Board and they are looking for people whose impact has positively and significantly shaped the Python world. Thomas’ work with the Python community very much exemplifies the ethos of “build the community you want to see.”


After receiving the award Thomas shared, "I'm incredibly proud of what we, as a community, have created and continue to create in the PSF: a caring, diverse, inclusive and considerate environment, and a stable foundation for everyone everywhere in the Python community to thrive and prosper."

Whether it was keeping meetings running smoothly, handling critical admin tasks, stepping up wherever needed, or acting as a historian of the PSF and Python’s evolution, Thomas has done it all—and with unmatched dedication.

Curious about previous recipients of the DSA or wondering how to nominate someone? Check out the PSF’s Distinguished Service Awards page. The PSF also bestows Community Service Awards to recognize outstanding community members– if you’d like to learn more about CSAs and how they differ from DSAs, check out our Service Awards given by the PSF: what are they and how they differ blog post.

March 12, 2025 11:33 AM UTC

March 11, 2025


PyCoder’s Weekly

Issue #672: Binary Data, Tail Calls, Pickles, and More (March 11, 2025)

#672 – MARCH 11, 2025
View in Browser »

The PyCoder’s Weekly Logo


Bytes Objects: Handling Binary Data in Python

In this tutorial, you’ll learn about Python’s bytes objects, which help you process low-level binary data. You’ll explore how to create and manipulate byte sequences in Python and how to convert between bytes and strings. Additionally, you’ll practice this knowledge by coding a few fun examples.
REAL PYTHON

Python Interpreter Adds Tail Calls

As part of the on-going performance improvement work, Python 3.14 is likely to include an optimization known as a “tail call”. Submitted changes are showing a 10% general speedup for some architectures. Read this article to learn the details.
DAROC ALDEN

Ship Integrations With 300+ APIs

alt

Nango is an open source platform that lets you ship robust native integrations with 300+ APIs. We offer hundreds of pre-built integrations, customizable in code, and developer tooling purpose built for scaling and maintaining integrations. For humans and AI agents. Try Nango for free →
NANGO INC. sponsor

Exploiting Python Pickles

Python has a built-in mechanism for serializing and deserializing objects known as “pickling”. It comes with the caveat that you should never use it with untrusted data, it can lead to remote code execution.
DAVID HAMANN

Django Security Releases: 5.1.7, 5.0.13 and 4.2.20

DJANGO SOFTWARE FOUNDATION

Quiz: What Is the Python Global Interpreter Lock (GIL)?

REAL PYTHON

Articles & Tutorials

Python while Loops: Repeating Tasks Conditionally

In this tutorial, you’ll learn about indefinite iteration using the Python while loop. You’ll be able to construct basic and complex while loops, interrupt loop execution with break and continue, use the else clause with a while loop, and deal with infinite loops.
REAL PYTHON

Quiz: Python while Loops: Repeating Tasks Conditionally

REAL PYTHON

Positron is Now Available for Beta Testing

Positron is a next-gen data science IDE built by Posit PBC. It’s an extensible tool for writing python & exploring data, designed for reproducible research & publishing. Consider trying Positron & offering the devs feedback in this beta period.
POSIT sponsor

Maybe Don’t Start With Unit Tests

Should you always start testing your code with unit tests? When does it make sense to look at integration or end-to-end testing as a first step instead? This week on the show, we speak with previous guest Eric Matthes about where to begin testing your code.
REAL PYTHON podcast

Open Graph Images in Django for Social Media

The Open Graph protocol specifies metadata for a webpage that gives third party sites information about the page. The most common use is to provide a preview image for social media sites. This post explains how to combine this into your Django projects.
AIDAS BENDORAITIS

Working With Python Polars

Welcome to the world of Polars, a powerful DataFrame library for Python. In this video course, you’ll get a hands-on introduction to Polars’ core features and see why this library is catching so much buzz.
REAL PYTHON course

Beating LinkedIn “Queens” With Python

LinkedIn publishes a daily logic puzzle called “Queens” that is a cross between a chess queen placement puzzle and Sudoku. This article shows how to write a Python script to solve the puzzles.
RODRIGO GIRÃO SERRÃO

ASCII Control Characters in My Terminal

Ever wonder about those ASCII control characters in your terminal, like CTRL-C to kill a program? Well wonder no more, Julia breaks down what they are and how they can be used.
JULIA EVANS

A Map of Python

View an interactive graph of the packages at PyPI, showing how many packages depend on each. The post also briefly describes the methodology for producing the chart.
FIEFDOM OF FILES

Pokémon With Reinforcement Learning

David and his colleagues have been using reinforcement learning to beat “Pokemon Red”, a single player JPRG from 1996. Learn about how they did it and see the code.
RUBENSTEIN, ET AL

Good Programmers Worry About Data Structures and Their Relationships

This opinion piece discusses a quote from Linus Torvalds, that good programmers worry about data structures and their relationships.
LEONARDO CREED

Which Python GUI Library Should You Use in 2025?

This post compares the Python GUI libraries available in 2025, including PyQT, PySide, TKinter, and Kivy.
MARTIN FITZPATRICK

Projects & Code

codegen-sdk: Scriptable Interface to Tree-Sitter

GITHUB.COM/CODEGEN-SH

phmutest: Troubleshoot Python Examples in Markdown

GITHUB.COM/TMARKTAYLOR

Variable Explorer in JupyterLab

GITHUB.COM/MLJAR • Shared by Piotr Plonski

time-machine: Travel Through Time in Your Tests

GITHUB.COM/ADAMCHAINZ

SciencePlots: Matplotlib Styles for Scientific Plotting

GITHUB.COM/GARRETTJ403

Events

Weekly Real Python Office Hours Q&A (Virtual)

March 12, 2025
REALPYTHON.COM

Python Weekend Abuja

March 13, 2025
CODECAMPUS.COM.NG

Python Atlanta

March 13 to March 14, 2025
MEETUP.COM

Python Weekend Abuja

March 15, 2025
CODECAMPUS.COM.NG

Python Weekend Abuja

March 17, 2025
CODECAMPUS.COM.NG


Happy Pythoning!
This was PyCoder’s Weekly Issue #672.
View in Browser »

alt

[ Subscribe to 🐍 PyCoder’s Weekly 💌 – Get the best Python news, articles, and tutorials delivered to your inbox once a week >> Click here to learn more ]

March 11, 2025 07:30 PM UTC


Real Python

Getting to Know Duck Typing in Python

Python makes extensive use of a type system known as duck typing. This system is based on an object’s behavior and interface. Many built-in classes and tools support this type system, which makes them pretty flexible and decoupled.

Duck typing is a core concept in Python. Understanding it will give you deeper insight into how the language works and, more importantly, how to use this approach in your own code.

In this video course, you’ll learn:


[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

March 11, 2025 02:00 PM UTC


Python Software Foundation

PSF Distinguished Service Award Granted to Van Lindberg

Van Lindberg, a longtime member of the PSF Board, has been recognized with the PSF’s Distinguished Service Award. Van was the co-chair and then Chair of PyCon from 2008-2012, served on the PSF Board for over a decade (2012–2023), including four years as Chair (2012–2016) and seven years as PSF General Counsel from 2016-2023. Throughout his time with us, Van was our go-to expert for all things legal, bringing invaluable insights from the broader open-source world to help the PSF grow and stay ahead of the curve. During his time on the board, Van was instrumental in establishing the PSF as a professional organization able to support the worldwide Python community.

The PSF’s Distinguished Service Award (DSA) is granted to individuals who make sustained exemplary contributions to the Python community. Each award is voted on by the PSF Board and they are looking for people whose impact has positively and significantly shaped the Python world. Van’s work with the Python community very much exemplifies the ethos of “build the community you want to see.”


After receiving the award, Van shared, “I am deeply honored to receive the DSA. The kindness and support of this community are truly exceptional, and I am grateful for every moment I've been able to spend contributing alongside so many excellent people.”

From licensing and hiring to fundraising, Van was there every step of the way as the PSF experienced phenomenal growth. His deep understanding of open-source communities—paired with his legal expertise—helped the Foundation navigate challenges and embrace opportunities to better serve the global Python community.

Curious about previous recipients of the DSA or wondering how to nominate someone? Check out the PSF’s Distinguished Service Awards page. The PSF also bestows Community Service Awards to recognize outstanding community members– if you’d like to learn more about CSAs and how they differ from DSAs, check out our Service Awards given by the PSF: what are they and how they differ blog post.

March 11, 2025 11:53 AM UTC

March 10, 2025


Real Python

Python News Roundup: March 2025

Spring isn’t the only thing in the air—new Python releases are here! Last month, Python’s core development team released versions 3.13.2, 3.12.9, and 3.14.0 alpha 5 of the language. The 3.14.0a5 version is the fifth of seven planned alpha releases. You can install this alpha release to try some new and exciting language features.

The PyPy project has also released a new version—7.3.19—featuring interpreters for Python 2.7, 3.10, and the newly introduced Python 3.11.

There’s also news from the Python Software Foundation (PSF), PyCon US 2025, PyCascades 2025, and the Python ecosystem.

Let’s dive in and explore what’s been happening in the world of Python!

Python Core Team Releases Bugfix Versions 3.13.2 and 3.12.9

On February 4, 2025, Python 3.13.2 was released as the second maintenance update for the 3.13 series. Packed with nearly 250 bug fixes and refinements, this release makes Python 3.13 even more stable and developer-friendly.

Python 3.13 introduces significant features and optimizations over Python 3.12, including an improved interactive interpreter and experimental free-threaded build mode. Explore the full changelog for detailed updates and changes in this bugfix release.

On a similar note, Python 3.12.9 was also released on February 4, 2025. It marks the ninth maintenance update in the 3.12 series. This release includes approximately 180 bug fixes, build improvements, and documentation updates since the previous release.

As always, the Python development team continues to enhance the language’s stability and performance with each release. For more details, refer to the full changelog. You can also support Python’s ongoing development through donations or sponsorship.

Python 3.14 Series Releases Fifth Alpha Version

The Python development team unveiled the fifth alpha release of Python 3.14 on February 11, 2025. This release is part of a series of seven planned alpha releases aimed at testing new features, bug fixes, and the release process before moving into the beta phase on May 6, 2025.

It’s important to note that this preview is not recommended for production environments. If you’re curious about the future of Python, installing this alpha version lets you explore the upcoming features before the final release. You’re encouraged to report any bugs via Python’s issues page. Again, for a detailed list of changes, check the full changelog.

PyPy Team Releases Version 7.3.19

The PyPy team has announced the release of version 7.3.19, which features interpreters for Python 2.7 and 3.10 and includes support for Python 3.11 in beta. The team plans to drop support for 3.10 and remove the beta label from 3.11 in the next release.

Read the full article at https://realpython.com/python-news-march-2025/ »


[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

March 10, 2025 02:00 PM UTC


Lucas Cimon

Quelques sites web que j'ai conçu

Au cours des 18 derniers mois, j'ai eu l'occasion de concevoir plusieurs sites web pour des proches et des associations où je suis bénévole.

Dans cet article, je reviens sur mes choix de solutions pour les mettre en place, et partage mes réflexions concernant les alternatives pour concevoir de "petits …


Permalink

March 10, 2025 09:08 AM UTC


Python Bytes

#423 Traveling the Python Universe

<strong>Topics covered in this episode:</strong><br> <ul> <li><strong><a href="https://github.com/danielenricocahall/pysqlscribe?featured_on=pythonbytes">pysqlscribe</a></strong></li> <li><strong><a href="https://fi-le.net/pypi/?featured_on=pythonbytes">A map of Python</a></strong></li> <li><strong><a href="https://martin.wojtczyk.de/2025/02/20/rust-c-and-python-trends-in-jobs-on-hacker-news-february-2025/?featured_on=pythonbytes">Rust, C++, and Python trends in jobs on Hacker News</a><a href="https://martin.wojtczyk.de/2025/02/20/rust-c-and-python-trends-in-jobs-on-hacker-news-february-2025/?featured_on=pythonbytes"> </a><a href="https://martin.wojtczyk.de/2025/02/20/rust-c-and-python-trends-in-jobs-on-hacker-news-february-2025/?featured_on=pythonbytes">(February</a><a href="https://martin.wojtczyk.de/2025/02/20/rust-c-and-python-trends-in-jobs-on-hacker-news-february-2025/?featured_on=pythonbytes"> 2025)</a></strong></li> <li><strong><a href="https://www.pythonmorsels.com/help-features/?featured_on=pythonbytes">The features of Python's help() function</a></strong></li> <li><strong>Extras</strong></li> <li><strong>Joke</strong></li> </ul><a href='https://www.youtube.com/watch?v=g6JsPyBaOcQ' style='font-weight: bold;'data-umami-event="Livestream-Past" data-umami-event-episode="423">Watch on YouTube</a><br> <p><strong>About the show</strong></p> <p>Sponsored by us! Support our work through:</p> <ul> <li>Our <a href="https://training.talkpython.fm/?featured_on=pythonbytes"><strong>courses at Talk Python Training</strong></a></li> <li><a href="https://courses.pythontest.com/p/the-complete-pytest-course?featured_on=pythonbytes"><strong>The Complete pytest Course</strong></a></li> <li><a href="https://www.patreon.com/pythonbytes"><strong>Patreon Supporters</strong></a></li> </ul> <p><strong>Connect with the hosts</strong></p> <ul> <li>Michael: <a href="https://fosstodon.org/@mkennedy"><strong>@mkennedy@fosstodon.org</strong></a> <strong>/</strong> <a href="https://bsky.app/profile/mkennedy.codes?featured_on=pythonbytes"><strong>@mkennedy.codes</strong></a> <strong>(bsky)</strong></li> <li>Brian: <a href="https://fosstodon.org/@brianokken"><strong>@brianokken@fosstodon.org</strong></a> <strong>/</strong> <a href="https://bsky.app/profile/brianokken.bsky.social?featured_on=pythonbytes"><strong>@brianokken.bsky.social</strong></a></li> <li>Show: <a href="https://fosstodon.org/@pythonbytes"><strong>@pythonbytes@fosstodon.org</strong></a> <strong>/</strong> <a href="https://bsky.app/profile/pythonbytes.fm"><strong>@pythonbytes.fm</strong></a> <strong>(bsky)</strong></li> </ul> <p>Join us on YouTube at <a href="https://pythonbytes.fm/stream/live"><strong>pythonbytes.fm/live</strong></a> to be part of the audience. Usually <strong>Monday</strong> at 10am PT. Older video versions available there too.</p> <p>Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to <a href="https://pythonbytes.fm/friends-of-the-show">our friends of the show list</a>, we'll never share it.</p> <p><strong>Michael #1:</strong> <a href="https://github.com/danielenricocahall/pysqlscribe?featured_on=pythonbytes">pysqlscribe</a></p> <ul> <li>A Python library intended to make building SQL queries in your code a bit easier.</li> <li>A Query object can be constructed using the QueryRegistry's get_builder featuring a dialect (e.g; "mysql", "postgres", "oracle").</li> </ul> <p><strong>Brian #2:</strong> <a href="https://fi-le.net/pypi/?featured_on=pythonbytes">A map of Python</a></p> <ul> <li>Cool visualization of dependencies in PyPI packages</li> <li><a href="https://anvaka.github.io/pm/#/galaxy/python?cx=-2700&cy=377&cz=5622&lx=-0.0869&ly=-0.2315&lz=-0.0338&lw=0.9684&ml=150&s=1.75&l=1&v=2015-09-27T13-00-00Z">Even cooler visualization</a> (linked from main article)</li> </ul> <p><strong>Michael #3:</strong> <a href="https://martin.wojtczyk.de/2025/02/20/rust-c-and-python-trends-in-jobs-on-hacker-news-february-2025/?featured_on=pythonbytes">Rust, C++, and Python trends in jobs on Hacker News</a><a href="https://martin.wojtczyk.de/2025/02/20/rust-c-and-python-trends-in-jobs-on-hacker-news-february-2025/?featured_on=pythonbytes"> </a><a href="https://martin.wojtczyk.de/2025/02/20/rust-c-and-python-trends-in-jobs-on-hacker-news-february-2025/?featured_on=pythonbytes">(February</a><a href="https://martin.wojtczyk.de/2025/02/20/rust-c-and-python-trends-in-jobs-on-hacker-news-february-2025/?featured_on=pythonbytes"> 2025)</a></p> <ul> <li>Interesting supply and demand comparisons from at least on source.</li> </ul> <p><strong>Brian #4:</strong> <a href="https://www.pythonmorsels.com/help-features/?featured_on=pythonbytes">The features of Python's help() function</a></p> <ul> <li>Trey Hunner</li> <li>Don’t forget how useful and cool help() is.</li> </ul> <p><strong>Extras</strong> </p> <p>Michael:</p> <ul> <li><a href="https://github.com/emmett-framework/granian/releases/tag/v2.0.1?featured_on=pythonbytes">Granian works with FastAPI again</a></li> </ul> <p><strong>Joke:</strong> <a href="https://devhumor.com/media/computer-engineer-vs-geologist?featured_on=pythonbytes">Computer engineer vs. Geologist</a></p>

March 10, 2025 08:00 AM UTC


Seth Michael Larson

Post Malone Oreos

@keyframes rotation { from { transform: rotate(0deg); } to { transform: rotate(359deg); } }

Apparently I talk about my love for Post Malone's music too much, because I received not one, but two unsolicited packages of Post Malone Oreos from a friend and a neighbor. So put in your diamond grills and let's try them!

Opening the package was a burst of caramel, like a caramel-scented candle from Bath & Body Works. The smell was so potent I would not be surprised if they didn't pump that in prior to sealing the packaging.

The actual flavor was not as strong, but still pretty sweet (enough to give you a 12Kt toothache). The salt and the shortbread were welcome in toning down the caramel sweetness.

Overall I liked the cookies! If you're a fan of Oreos and caramel then they are a must-try! My recommended musical pairing for these snacks is 'Circles', which in retrospect might have been about Oreo cookies all along! ⚫⚪

If you're curious about the circular word-wrapping (check out the page on desktop) I read this lovely article about CSS shapes from Sara Soueidan. I cropped a picture of an Oreo using iPhone's "Smart Select" feature for making stickers and exported that as a PNG.

March 10, 2025 12:00 AM UTC

March 09, 2025


Ned Batchelder

Faster branch coverage measurement

After nearly two years, I think this is finally ready: coverage.py can use sys.monitoring to more efficiently measure branch coverage.

I would love for people to try it, but it’s a little involved at the moment:

Once you have both of those things, set the environment variable COVERAGE_CORE=sysmon and run coverage as you usually do. If all goes well, it should be faster. Please let me know!

Feedback is welcome in GitHub issues or in the #coverage-py channel in the Python Discord server.

This has been a long journey, starting when I first commented on PEP 669 that underpins this work. Mark Shannon and I have had many back and forths about the behavior of sys.monitoring, finally landing on something that would work for us both.

For the curious: traditionally coverage.py relied on sys.settrace. Python calls my recording function for every line of Python executed. It’s simple and effective, but inefficient. After I’ve been told a line was executed once, I don’t need to be told again, but settrace keeps calling my function. The new sys.monitoring that arrived in Python 3.12 lets me disable an event once it’s fired, so after the first ping there’s no overhead to running that same code multiple times.

It took a while to iron out the event behavior that lets us measure branches as well as lines, but Python 3.14.0 after alpha 5 has it, so we’re finally able to announce coverage.py support for people to try out.

March 09, 2025 08:07 PM UTC

March 08, 2025


Django Weblog

Happy International Women&#x27;s Day! 🎉 💜

This International Women's Day, we're celebrating a historic milestone in Django’s journey! 🚀

For the first time ever, Django has women in every leadership position within the project:

This moment is not just about numbers — it’s about the impact of years of effort to create a more inclusive and welcoming Django community.

A huge shoutout to Django Girls for introducing countless women to tech and Django, and to Djangonaut Space for mentoring a diverse set of contributors—many of whom have stepped into leadership roles. In fact, 4 out of 6 women who put their name forward in the latest Board elections were Djangonaut Space alumni.

Django thrives when our community grows more diverse, more representative, and more empowered. Today, we celebrate the progress, the leaders, and everyone working to make Django a space where everyone belongs.

Happy International Women's Day! 🎉 💜

March 08, 2025 09:32 AM UTC