skip to navigation
skip to content

Planet Python

Last update: December 02, 2026 07:47 PM UTC

December 02, 2026


The Python Show

58 - Python Memory Graph with Bas Terwijn

On this week's Python Show, we have special guest Bas Terwijn, author of memory_graph, a Python package similar to Python Tutor that you can run locally on your machine and use for much larger Python applications than Python Tutor can support.

Learn more about memory_graph here:

December 02, 2026 02:09 PM UTC


Hugo van Kemenade

Steering Council election

The Python Steering Council election is on!

This year nine candidates are running for the five seats, and only two have served before.

This is the first time all nominations came in more than three days before the deadline. And apart from the special first election, this is the most nominations to arrive in the first week.

See PEP 8108 for links to their nomination statements and PEP 13 for more on Python language governance.

This is our second year using a new voting system: with “Multi-winner Bloc STAR” you give between 0-5 stars per candidate.

If you’re in the core team, remember to vote by 16th December!

December 02, 2026 01:11 PM UTC


Django Weblog

Django security releases issued: 6.1.4, 6.0.11, and 5.2.20

In accordance with our security release policy, the Django team is issuing releases for Django 6.1.4, Django 6.0.11, and Django 5.2.20. These releases address the security issues detailed below. We encourage all users of Django to upgrade as soon as possible.

CVE-2026-124827: Server-side file-write via RasterField assignment

Assigning a raster data definition to django.contrib.gis.db.models.RasterField with a user-controlled name parameter and a non-default driver could cause GDAL to write a file to an attacker-controlled location. Depending on the raster driver, this could enable remote code execution. Because RasterField falls back to the CharField form field, the flaw was reachable by default on models with RasterField registered in the admin or using ModelForms or writable model serializers.

RasterField now defaults editable to False, excluding it from a ModelForm unless explicitly included. RasterField also now raises GDALException when assigning a dict or JSON string specifying a non-default driver. To use other drivers, wrap the definition in GDALRaster to signify the value is trusted. This exception only limits server-side file writes. Server-side request forgery is still possible if untrusted input is assigned to RasterField. See raster security considerations and implement validation before accepting untrusted input.

Geometry fields were not affected. RasterField is only implemented on PostGIS.

This issue has severity "high" according to the Django security policy.

Thanks to Mohammed Fathy for the report.

CVE-2026-115868: Potential cross-site scripting vulnerability in truncatechars_html

The truncatechars_html template filter and the django.utils.text.Truncator.chars() method (with html=True) were subject to a potential cross-site scripting (XSS) attack when certain inputs whose text length matched the truncation length were processed and rendered in an HTML attribute.

This issue has severity "moderate" according to the Django security policy.

Thanks to JoeCyberTech for the report.

CVE-2026-125673: Potential cache poisoning via dot segments in request paths

django.middleware.cache.UpdateCacheMiddleware and django.views.decorators.cache.cache_page() were affected by a bug in django.http.HttpRequest.build_absolute_uri(), which incorrectly normalized request paths containing . or .. segments. Under certain deployment and URL configurations, this could allow an unauthenticated attacker to cause cached responses to be served for unintended URLs.

django.http.HttpRequest.build_absolute_uri() now preserves dot segments in the request path when called without a location. Existing cached responses are not invalidated, so users should clear any potentially affected caches after upgrading.

This issue has severity "low" according to the Django security policy.

Thanks to 4drez for the report.

CVE-2026-119642: Information leakage in admin changelist via "pk" alias for OneToOneField

The admin changelist allowed staff users with view permissions on a registered model with a custom django.db.models.OneToOneField primary key to enumerate data from those models by including the pk alias in the querystring and performing repeated lookup searches. This requires sufficient knowledge of the fields on the related model. It is a special case of CVE-2010-4534.

Models using multi-table inheritance were affected by default, as the implicit primary key field created by Django is a OneToOneField.

This issue has severity "low" according to the Django security policy.

Thanks to JoeCyberTech for the report.

CVE-2026-127929: Information leakage in admin changelist via reverse relations

The admin changelist allowed staff users with view permissions on a registered model to enumerate values on those models via manipulating the querystring to perform repeated lookup searches. This requires knowledge of the related model names or django.db.models.ForeignKey.related_query_name overrides. It is a special case of CVE-2010-4534 that regressed in Django 5.0.3.

This issue has severity "low" according to the Django security policy.

Thanks to OpenAI for the report.

CVE-2026-132809: Heap buffer overflow in OGRGeometry.wkb

The django.contrib.gis.gdal.OGRGeometry.wkb property allocated an undersized buffer for geometries larger than 4GB on 64-bit platforms. This could result in segmentation faults or undefined behavior. The hex and geos properties of OGRGeometry and its pickling were also affected.

This issue has severity "low" according to the Django security policy.

Thanks to Zhixi "Jace" Sun for the report.

CVE-2026-132092: Potential SQL injection in range and in lookups

The range and in lookups were subject to SQL injection in queries involving aliases or key transforms containing percent signs. The __range flaw required incorrectly using more than two right-hand side values. The __in flaw required a bilateral transform.

The range lookup now requires exactly two right-hand side values.

Note that using percent signs in column aliases and key transforms was deprecated in Django 6.0 and is scheduled for removal in Django 2028.

This issue has severity "high" according to the Django security policy.

Thanks to Cristian Panaro for the report.

Affected supported versions

Resolution

Patches to resolve the issue have been applied to Django's main, 6.1, 6.0, and 5.2 branches. The patches may be obtained from the following changesets.

CVE-2026-124827: Server-side file-write via RasterField assignment

CVE-2026-115868: Potential cross-site scripting vulnerability in truncatechars_html

CVE-2026-125673: Potential cache poisoning via dot segments in request paths

CVE-2026-119642: Information leakage in admin changelist via "pk" alias for OneToOneField

CVE-2026-127929: Information leakage in admin changelist via reverse relations

CVE-2026-132809: Heap buffer overflow in OGRGeometry.wkb

CVE-2026-132092: Potential SQL injection in range and in lookups

The following releases have been issued

The PGP key ID used for this release is Jacob Walls: 131403F4D16D8DC7

General notes regarding security reporting

As always, we ask that potential security issues be reported via private email to security@djangoproject.com, and not via Django's Trac instance, nor via the Django Forum. Please see our security policies for further information.

December 02, 2026 01:00 PM UTC


Python Software Foundation

PSF Grants Program Funding Round: May 1 - September 30, 2027

As we announced in our last post about grants, the Python Software Foundation (PSF) is reopening the PSF Grants Program with a restructured schedule of two funding rounds per year. This post outlines eligibility, grant types, caps, schedule and more details for the upcoming funding round that covers Python conferences and workshops taking place between May 1 and September 30, 2027. 

One big change we’d like to highlight is that we have brought on a new piece of software to manage our grant-making process: Good Grants. This new platform is integrated with psfmember.org and will significantly reduce workload for our program administrators and Grants Work Group (GWG). It should also provide a more modern and automated process for the program’s applicants. More information below!

The upcoming funding round

Eligibility Timeframe & Exceptions

The upcoming Grants Program Funding Round will be scoped to Conferences and Workshops of all types that are scheduled between May 1 and September 30, 2027. 

Based on feedback from the community and the first grants funding round we are also introducing an exception to this time frame. Events that take place before May 1st, 2027, but no earlier than March 1st, may also apply. The PSF understands that each funding round cycle is quite long (~8 months from applications opening to the end of the eligibility period) and that many community events are organized on a shorter cycle. This exception hopes to address this gap and provide more opportunities for community events to receive grants. Applications that fall outside of the standard May 1 - September 30 eligibility time frame will be given second priority. 

Grant Types & Caps

To continue our focus on sustainability for the PSF Grants Program, we are maintaining a limited scope for grant types and caps. 

Categories of grants that will be considered (includes virtual):


The upcoming Grants Program Funding Round will maintain the following caps:


Please note that the caps are the maximum amount applicants can request. The guidelines the Grants Work Group observes are generally as follows:

The GWG will not consider exceptions to exceed the maximum, and if you don’t need the maximum, please ask for less. 

Notes on Scope, Criteria, and Communication

All previous criteria and guidelines for the PSF Grants Program will be applied to this funding round. This post won’t go over every single piece of information required on the application, but we want to highlight a couple of things:

Detailed Upcoming Funding Round Schedule

Listed in the table below is the anticipated schedule for the upcoming PSF Grants Program Funding Round. Based on our experiences from the last funding round, we have:

Please note that applications open in a couple of weeks!

Date Phase Description
December 14, 2026 - January 4, 2027 Application Applications open; PSF Staff performs initial reviews as applications are received; missing information is collected
Note: There are several PSF holidays during this time frame so responses may be delayed.
January 4 - 11 Initial review PSF Staff perform in depth reviews and continue to gather missing information
January 11 - February 4 GWG review Grants Work Group review; clarifying information collected as needed
February 4 - 10 Vote Grants Work Group votes
February 11 - 19 Decision Decisions communicated to applicants
February 11 and onwards Disbursement Funds disbursed
.table { display: block; overflow-y: hidden; overflow-x: auto; scroll-behavior: smooth; } .table thead { display: table-header-group; vertical-align: middle; border-color: inherit; color: inherit; background: darkcyan; } table, th, td { border: 1px solid black; border-collapse: collapse; } tr { display: table-row; vertical-align: inherit; border-color: inherit; } table th { padding: 16px; text-align: inherit; border-bottom: 1px solid black; color:white!important; } tbody { display: table-row-group; vertical-align: middle; border-color: inherit; } table:not(.tr-caption-container) { min-width: 100%; border-radius: 3px; }
After things kick off, the PSF may need to adjust dates by a couple days here and there. This program is dependent on just a couple of staff (Hi, Marie and Laura!) and our wonderful Grants Work Group (Thank you, team!) that is composed of volunteers. If dates need to be adjusted, we will be sure to communicate that directly to applicants.

The PSF asks that applicants closely monitor their emails from the point they submit their application to the end of the review phase. We would be disappointed to see events and initiatives miss out on grant funding due to gaps in their application. The more responsive applicants can be, the better!
 

Good Grants: How to Apply

As we mentioned at the beginning of this post, we are introducing Good Grants, a new platform for the PSF’s grant making processes. The platform has a lot of capabilities, which we are just beginning to explore. The PSF expects to introduce more features and automation round over round as we get to know the platform. Applicants are encouraged to provide feedback about the new platform as we learn to use it together!

Here’s how to login an apply:

Find more information about customizing your account in Good Grant’s ‘Ultimate Guide for Applicants’ knowledge base article.

Questions or feedback?

The PSF expects questions and feedback about both the reopened Grants Program restructure and the upcoming funding round. Your feedback will help us improve during the process and for future rounds. There are multiple ways for you to reach out to us with your questions, feedback, and comments:


This is big news! And, applications for the next round are opening soon. To help answer the community’s questions, we are holding supplemental PSF Grants Program Office Hours on the PSF Discord:

Check out what times these are for you using this timezone converter. We welcome you to join us to ask your questions, discuss the process, suggest ideas for future rounds, or anything else related to the PSF Grants Program. 

About the Python Software Foundation

The Python Software Foundation is a US non-profit whose mission is to promote, protect, and advance the Python programming language, and to support and facilitate the growth of a diverse and international community of Python programmers. The PSF supports the Python community using corporate sponsorships, grants, and donations. Are you interested in sponsoring or donating to the PSF so we can continue supporting Python and its community? Check out our sponsorship program, donate directly, or contact our team at sponsors@python.org!

December 02, 2026 12:27 PM UTC


Tryton News

Tryton News December 2026

December is dominated by languages and by lock-downs of sensitive data. Translated fields are read and written in several languages within one call, a scheduled task keeps the local translations current, and a whole set of changes makes sure that passwords, tokens and credentials stay out of reach of users who have no business reading them. On the surface, the carrier configuration moves into a notebook and cron and queue records finally say what they run. All of this follows the Tryton 8.2 release and builds on our last LTS release 8.0.

For an in depth overview of the Tryton issues please take a look at our issue tracker or see the issues and merge requests filtered by label.

Changes for the User

Sales, Purchases and Projects

The carrier form now groups its settings in a notebook. Other modules add their own carrier options, and the single long page had become hard to survey. The pages keep the basic data, the costs and the extra settings apart, so the layout stays readable as the number of carriers grows.

The web shop of a sale order turns read-only as soon as the sale is saved, so web shop and web id always stay in sync.

The Shopify connection no longer creates a contact mechanism from an invalid phone number, it validates the phone number that arrives with an address, and it filters out order numbers that are already in the database when fetching new orders.

Accounting, Invoicing and Payments

SEPA payments are matched on the EndToEndId reference alone. The previous matching was too strict for the statements some banks deliver, so payments that belonged to an invoice stayed unreconciled.

Stock, Production and Shipments

An inventory line whose counted quantity is zero now gets a quantity to fix, so counting an empty location works as expected.

User Interface

Dates in PYSON expressions keep the calendar date the user typed instead of shifting by the timezone offset, so a condition on a date field evaluates against the day that is shown in the form.

Removing a line from a not yet saved One2Many no longer opens the search window, and records are destroyed only after the server confirms the deletion, so a failed delete leaves the line in place instead of dropping it from the view.

The buttons of a dictionary field react as soon as its lines appear, and adding a key to a dictionary field keeps the keys that are already there instead of resetting them. Fields such as the street of an address and the code of a product that is numbered by a sequence are now blocked with a non-editable state instead of a read-only one.

System Data and Configuration

A cron task record now shows the method it runs in its name instead of a bare number. Cron and queue names appear wherever a failure is listed, so the message says which action went wrong. Queued tasks carry the id, the model and the method of the task in the same way.

A new scheduled task synchronises the local translations for every translatable language. The translation wizards had to be run by hand in a fixed order and could take a long time on a large database, so the interface and the record translations now stay current without somebody remembering to start them.

The VIES check of VAT numbers is limited to 20 identifiers per run, which keeps the periodic validation inside the rate limits of the public service on large databases.

A cron record is now editable while its task is not running.

New Documentation

The module development tutorial now explains how to extend an existing method of a base model, which is the usual way to add behaviour on top of a standard module.

New Releases

Bug fixes land regularly on the 8.2 series and on the maintained long term support series 8.0, 7.8 and 7.0. See the release process for the support window of each series.

Security

User credentials are locked down. The reset password of a user can no longer be read, password fields are excluded from searches, and a set of sensitive fields can no longer be stored as user preferences.

Access rights are enforced when the label of a selection value is read, when a translated field is read through a language suffix, and when resource data is exported, so a user no longer sees values they are not allowed to read.

Wizard execution is restricted. A wizard session belongs to the user who created it, and wizards without a model or group restriction run only for administrators.

Service credentials moved behind administrator groups, the Chorus pro secret and password for accounting and the Shopify token and secret for sales. The OCR service in the incoming documents module gained the document administrator group it was missing, and quality alerts got the company access rule they lacked.

Incoming requests limit the size of the decompressed body, which closes a resource-exhaustion vector through compressed payloads. The session cookie is marked secure only for secure requests, so plain HTTP deployments keep working while HTTPS deployments get the flag.

Update the server to benefit from all of the above.

Changes for the System Administrator

The Stripe payment integration moves to the 2026-10-28.endive and 2026-11-18.endive API versions, so installations that take card payments should upgrade before Stripe retires the older versions.

The SAO client installs its dependencies without the development tool chain and keeps grunt as a development-only dependency. A production install no longer pulls the build tools, and grunt is needed only when SAO is rebuilt from source. The minimal node.js version for such a build is raised to v24 or later.

Changes for Implementers and Developers

Translated fields accept any language suffix on read and several languages in one create or write call, which removes the per-language round trip in synchronisations that export or compare languages.

delete_many() on the FileStore is renamed to deletemany(), in line with the other method names of the interface. Update the modules that call it directly.

SAO code uses includes() in place of the ~indexOf and contains idioms, and the translation files are converted with gettext-parser instead of grunt-po2json.

Views now express availability through editable rather than inverted readonly conditions, so a custom view that only wants to block editing should set editable="False".

Initial draft powered by qwen3.8-flash. Curated and finalized by human hands.

1 post - 1 participant

Read full topic

December 02, 2026 07:00 AM UTC


Python GUIs

Clearing the canvas in QPainter — Fix the common black background issue when painting on a QPixmap in PyQt6

My canvas is not clearing every time I run my painting app, and on Windows the background appears black instead of white. How do I properly clear or fill the canvas when using QPainter and QPixmap in PyQt6?

If you've been following along with QPainter tutorials and find that your canvas has a black background — or that previous drawings aren't being cleared properly — you're running into one of the most common gotchas when working with QPixmap in PyQt6, especially on Windows.

The good news is that the fix is simple: you just need to explicitly fill your QPixmap with a color when you create it.

Why does the canvas appear black?

When you create a new QPixmap, the pixel data it contains is uninitialized. On some platforms (particularly Windows), this uninitialized data shows up as solid black. On other platforms, you might see random garbage pixels or a transparent background. The behavior is unpredictable because you're looking at whatever happened to be in that block of memory.

The solution is to fill the pixmap with your desired background color right after creating it.

Filling the canvas with a background color

Here's how to create a QPixmap and fill it with white:

python
from PyQt6 import QtGui

canvas = QtGui.QPixmap(400, 300)
canvas.fill(QtGui.QColor("#ffffff"))  # Fill entire canvas with white.

The fill() method sets every pixel in the pixmap to the color you specify. By calling it immediately after creating the pixmap, you ensure a predictable background before you start drawing anything.

You can use any color you like — #ffffff or Qt.GlobalColor.white for white, or any other QColor value.

A complete working example

Here's a full example that creates a small painting application. The canvas starts with a white background, and you can click buttons to draw shapes on it. Notice how canvas.fill() is called right after the QPixmap is created.

python
import sys

from PyQt6 import QtCore, QtGui, QtWidgets


class MainWindow(QtWidgets.QMainWindow):
    def __init__(self):
        super().__init__()

        self.canvas = QtGui.QPixmap(400, 300)
        self.canvas.fill(QtGui.QColor("#ffffff"))  # Start with a white canvas.

        self.label = QtWidgets.QLabel()
        self.label.setPixmap(self.canvas)

        button_draw = QtWidgets.QPushButton("Draw Rectangle")
        button_draw.clicked.connect(self.draw_rectangle)

        button_clear = QtWidgets.QPushButton("Clear Canvas")
        button_clear.clicked.connect(self.clear_canvas)

        layout = QtWidgets.QVBoxLayout()
        layout.addWidget(self.label)
        layout.addWidget(button_draw)
        layout.addWidget(button_clear)

        container = QtWidgets.QWidget()
        container.setLayout(layout)
        self.setCentralWidget(container)

    def draw_rectangle(self):
        painter = QtGui.QPainter(self.canvas)
        pen = QtGui.QPen()
        pen.setWidth(3)
        pen.setColor(QtGui.QColor("#333333"))
        painter.setPen(pen)
        painter.drawRect(50, 50, 200, 150)
        painter.end()
        self.label.setPixmap(self.canvas)

    def clear_canvas(self):
        self.canvas.fill(QtGui.QColor("#ffffff"))  # Reset to white.
        self.label.setPixmap(self.canvas)


app = QtWidgets.QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()

Copy and run this to see it in action. Click "Draw Rectangle" to paint a shape, then click "Clear Canvas" to reset everything back to white. If you're new to building PyQt6 applications, see creating your first window for a beginner-friendly introduction.

How clearing works

The clear_canvas method does the same thing we did during initialization — it calls self.canvas.fill() to overwrite every pixel with white, then updates the QLabel by calling setPixmap() again. That's all there is to it. You don't need to call self.update() or any other manual refresh method when you're displaying your pixmap through a QLabel, because setPixmap() already triggers a repaint of the label widget.

When do you need self.update()?

If you're painting directly in a widget's paintEvent method (rather than painting onto a QPixmap displayed in a QLabel), then you would need to call self.update() to schedule a repaint after changing your drawing data. This approach is common when creating your own custom widgets. But when you're working with a QPixmap and a QLabel as shown above, calling setPixmap() handles the display update for you.

Summary

Whenever you create a QPixmap to use as a drawing canvas:

  1. Call canvas.fill() immediately after creation to set a known background color.
  2. To clear the canvas later, call canvas.fill() again with your background color.
  3. After modifying the pixmap, call label.setPixmap(canvas) to update the display.

This approach works reliably across all platforms and avoids the black background issue entirely. For more advanced drawing techniques, including working with QPainter paths and shapes, check out the QPainter and bitmap graphics tutorial.

For an in-depth guide to building Python GUIs with PyQt6 see my book, Create GUI Applications with Python & Qt6.

December 02, 2026 06:00 AM UTC


Python Bytes

#507 Something about security

<strong>Topics covered in this episode:</strong><br> <ul> <li><strong><a href="https://broyojo.com/python-formalization?featured_on=pythonbytes">AI agents model CPython in Lean and produce 415 bug reports</a></strong></li> <li><strong><a href="https://aws.amazon.com/about-aws/whats-new/2026/12/amazon-athena-now-powered-by-duckdb?featured_on=pythonbytes">Amazon Athena powered by DuckDB, now available in preview</a></strong></li> <li><strong><a href="https://citry.dev/blog/citry-1-0-0/?featured_on=pythonbytes">Citry</a></strong></li> <li><strong><a href="https://pyfound.blogspot.com/2026/11/psf-security-roadmap-2027.html?featured_on=pythonbytes">PSF announces a Security Roadmap</a></strong></li> <li><strong>Extras</strong></li> <li><strong>Joke</strong></li> </ul><a href='https://www.youtube.com/watch?v=Zwxjaw9WU2M' style='font-weight: bold;' data-umami-event="Livestream-Past" data-umami-event-episode="507">Watch on YouTube</a><br> <p><strong>Michael #1: <a href="https://broyojo.com/python-formalization?featured_on=pythonbytes">AI agents model CPython in Lean and produce 415 bug reports</a></strong></p> <p>David Andrews and Chao Zhang used AI agents to translate CPython 3.15.2 functions into Lean and check proofs about their behavior. Their November 13 post reports 4,067 accepted functions, 614,384 lines of Lean, and 415 bug reports, including about 55 involving crashes or memory corruption.</p> <ul> <li>Coverage is 14.3% of functions worth checking, not a fully verified interpreter. Multithreading is out of scope.</li> <li>Each model faces at least 50,000 differential test inputs, proofs, and review by a second agent before acceptance.</li> <li>A valid Lean proof can still describe the wrong model. Early reviews rejected weak properties that even broken functions could satisfy.</li> <li>415 reports does not mean 415 newly confirmed upstream bugs: some were already known, and remaining reports are being submitted.</li> <li>I asked what involvement the core team and CPython had with Project Glasswing. I think it was zero. It should be far more involved. Open someone reaches out to <a href="https://red.anthropic.com/oss-scanner/?featured_on=pythonbytes">OSS Scanner</a>.</li> </ul> <p><strong>Calvin #2: <a href="https://aws.amazon.com/about-aws/whats-new/2026/12/amazon-athena-now-powered-by-duckdb?featured_on=pythonbytes">Amazon Athena powered by DuckDB, now available in preview</a></strong></p> <ul> <li>Remember when AWS bought DuckLabs? Here's what they built.</li> <li>Announced Dec 1, 2026 at re:Invent and in preview in 5 regions: us-east-1, us-east-2, us-west-2, eu-west-1 and ap-northeast-1.</li> <li>Athena's serverless query service now runs on DuckDB and splits a single query across many workers when the data outgrows one machine.</li> <li>AWS claims queries are up to 2x faster and up to 50% cheaper than Athena engine v3 on large datasets.</li> <li>Queries use DuckDB's SQL dialect and run against your existing Glue Data Catalog tables, so there's nothing to redefine and no data to move.</li> <li>Results can come back as Apache Arrow through a new streaming API and an ADBC driver, landing in data science tools with no conversion step.</li> <li>A new open-source Athena extension for DuckDB lets you prototype a query in local DuckDB and then run the same SQL on Athena at scale.</li> <li>Supports Apache Iceberg v3 and Parquet tables. To turn it on, create a workgroup or switch an existing one to DuckDB.</li> <li>Related: a separate Redshift extension for DuckDB (Apache 2.0, DuckDB v2.0.1) lets you query Redshift from a local DuckDB session and join the results with local Parquet or CSV files.</li> </ul> <p><strong>Michael #3: <a href="https://citry.dev/blog/citry-1-0-0/?featured_on=pythonbytes">Citry</a></strong></p> <p>Citry's first stable release puts HTML templates, CSS, browser behavior and Python event handlers in one component class. Built by django-components maintainer Juro Oravec, it aims to give Python web developers Vue-style tooling without maintaining a separate frontend project. Clicks can call Python and replace the component's HTML.</p> <ul> <li>The editor catches template typos and wrong component inputs before someone opens the page. Run the checks in CI with citry check; useful feedback for humans and coding agents alike.</li> <li>Uses Vue for browser behavior, rather than eliminating JavaScript. Works with Django, FastAPI, Flask and other ASGI/WSGI apps.</li> <li>Author's <a href="https://citry.dev/about/benchmarks/?featured_on=pythonbytes">error benchmark</a> reports 56 of 61 applicable mistakes before runtime, including nine warnings. Four go undetected, including a secret sent to the browser.</li> <li>Author's speed test: 257 ms until usable for 1,400 entries on the second server load, empty browser cache, local M4 Mac/Chromium. Single-measurement charts, not a general speed ranking.</li> <li>1.x promises SemVer compatibility; citry-ui remains pre-1.0. django-components enters maintenance mode. Try the browser playground at https://citry.dev/playground/.</li> </ul> <p><strong>Calvin #4:</strong> <a href="https://pyfound.blogspot.com/2026/11/psf-security-roadmap-2027.html?featured_on=pythonbytes">PSF announces a Security Roadmap</a></p> <ul> <li>The PSF's security plan for the coming year (posted Nov 30, 2026) has four focus areas: PyPI malware remediation, "compromise resilience" for PyPI and <a href="http://python.org/?featured_on=pythonbytes">python.org</a>, more capacity for vulnerability advisories, and post-quantum crypto readiness. Alpha-Omega and Anthropic fund the security staff.</li> <li>Malware: PyPI will lean more on automatic quarantine. Today it fires only when several trusted reporters flag the same project. It handled the Telnyx attack in April, about 2 hours after the first report and 3h 42m after upload. A new "Malware Triager" role will be able to handle reports without full PyPI admin access.</li> <li>Compromise resilience: the goal is for installers to reject tampered artifacts. How that works hasn't been decided, and several proposals are being evaluated. The PSF will also write a "Compromise Recovery Runbook" and test it regularly. A "Secure Python Distributions" program would check that redistributors verify <a href="http://python.org/?featured_on=pythonbytes">python.org</a>'s Sigstore signatures.</li> <li>Vulnerabilities: the PSF says LLMs and agents are driving a sharp rise in known open-source vulnerabilities. The Python Security Response Team is handling about 4x more than a year ago. The PSF will evaluate making the PyPA advisory database the authoritative source, with maintainers able to correct entries.</li> <li>Post-quantum: a draft PEP targets the Python 3.16 feature window (May 2027) and will set a schedule for quantum-safe algorithms in the standard library. It's by Emma Smith, Bénédikt Tran, and Seth Larson and hasn't been published for review yet. PyPI and <a href="http://python.org/?featured_on=pythonbytes">python.org</a> get post-quantum TLS first. A schedule for retiring quantum-vulnerable key exchange will come later.</li> <li> <strong>Extras</strong></li> </ul> <p>Calvin:</p> <ul> <li>More interesting AWS announcements this week <ul> <li><a href="https://github.com/aws/credential-daemon?featured_on=pythonbytes">credential-daemon</a></li> <li><a href="https://aws.amazon.com/about-aws/whats-new/2026/12/continuum-software-supply-chain-preview/?featured_on=pythonbytes">AWS Continuum for software supply chain</a></li> </ul></li> </ul> <p>Michael:</p> <ul> <li><a href="https://buttondown.com/ladybird/archive/ladybird-alpha?featured_on=pythonbytes">Ladybird's alpha</a> is ready to download for macOS and Linux</li> <li><a href="https://www.djangoproject.com/weblog/2026/dec/01/welcome-our-executive-director/?featured_on=pythonbytes">Django Software Foundation's has its first Executive Director</a></li> </ul> <p><strong>Joke:</strong> <a href="https://www.instagram.com/reels/DdLU2aYO-3n/?featured_on=pythonbytes">Fewer wishes</a></p>

December 02, 2026 12:03 AM UTC

December 01, 2026


PyCoder’s Weekly

Issue #763: K-Means Clustering, Advent of Code Prep, TypedDict, and More (2026-12-01)

#763 – DECEMBER 1, 2026
View in Browser »

The PyCoder’s Weekly Logo


K-Means Clustering in Python: A Practical Guide

Learn how to perform k-means clustering in Python with scikit-learn, choose the right number of clusters, and build an end-to-end clustering pipeline.
REAL PYTHON

Advent of Code Tips for Beginners

Advent of Code has started and this post shares a case study of how to approach solving a problem and debugging issues.
JUHA-MATTI SANTALA

Keep Vulnerable and Brand-New Packages Out of Pip

A Python package can reach your laptop the hour it’s published, or with a known CVE. With Posit Package Manager, your administrators block versions above a CVSS score they set and hold new releases until they reach an age they choose. Read How Vulnerability Blocking and Cooldown Work
POSIT sponsor

TypedDict With Extra Items

Python 3.15 added a new feature to the TypedDict class, it now can accept extra items of a given type.
RODRIGO GIRÃO SERRÃO

Polars 2.2 Released

POLA.RS

Articles & Tutorials

Objects, Attributes, Maps, Oh My!

The dynamic nature of Python and similar languages makes the structure of a class object problematic: the ability to add attributes later means they can’t just be packed side-by-side in memory. This post talks about how Python and other languages solve this problem.
MAX BERNSTEIN

Chameleon Templates, Modernized: chameleon-rs

Michael rewrote the Chameleon templating library in Rust to make Python web apps faster. chameleon-rs runs your existing templates unchanged and adds async rendering, Markdown, and free-threaded Python support.
MICHAEL KENNEDY

Free-Threaded Python

Talk Python interviews Christopher Ariza and they talk about the zombie-GIL. How even if your code is free-threaded, all it takes is one library to be GIL dependent and you’re back where you started.
TALK PYTHON

X Is for XML Parsing

BeautifulSoup is a popular library for parsing information from XML and HTML documents. This post teaches you how to parse a document and find parts of it with CSS selectors.
JUHA-MATTI SANTALA

Unnecessary Syntax in Python

Unnecessary syntax in Python isn’t always unhelpful. An explicit return None, an else, a keyword argument, or a trailing comma can make your code more readable.
TREY HUNNER

LangChain Tutorial: From Prompts to RAG and AI Agents

Learn LangChain in Python step by step. This hands-on LangChain tutorial covers chat models, prompt templates, LCEL chains, RAG, and tool-calling agents.
REAL PYTHON

Build an AI Agent From Scratch in Python

Learn how the agentic loop works by building an AI agent from scratch in Python, with conversation context and tool calling in about 90 lines of code.
REAL PYTHON course

pandas Project: Make a Gradebook With Python & pandas

Build a pandas project that calculates class grades from several data sources. Load, merge, and save data, then plot summary statistics with pandas.
REAL PYTHON

Profile Your Polars Queries

Polars now lets you create a query profile for your locally running queries, learn more how to find out what your code is doing.
CHIEL PETERS

Startup Configuration Files

This post teaches you how to use startup configuration files to run package entry points when the Python interpreter starts up.
RODRIGO GIRÃO SERRÃO

Python Bindings: Calling C or C++ From Python

Learn how Python bindings let you call C or C++ code from Python, and compare tools like ctypes, CFFI, PyBind11, and Cython.
REAL PYTHON

Website Screenshots With Django, Celery, and Playwright

This tutorial looks at how to build a Django app that takes website screenshots using Playwright and Celery.
NIK TOMAZIC

Projects & Code

polars-stats: Polars Expressions for Probability Distributions

GITHUB.COM/FBRUZZESI • Shared by Francesco Bruzzesi

Pytml: Run Python in HTML With One Script Tag

GITHUB.COM/NODEX-AR

imre: Experimental Ahead-of-Time Compiler for Typed Python

GITHUB.COM/ASTRAL-EXPERIMENTS

cyclopts: Intuitive CLIs Based on Python Type Hints

GITHUB.COM/BRIANPUGH

django-hurricane: High-Perf, Django-Native Application Server

GITHUB.COM/DJANGO-HURRICANE

Events

Weekly Real Python Office Hours Q&A (Virtual)

December 2, 2026
REALPYTHON.COM

Canberra Python Meetup

December 3, 2026
MEETUP.COM

Sydney Python User Group (SyPy)

December 3, 2026
SYPY.ORG

Melbourne Python Users Group, Australia

December 7, 2026
J.MP

PyBodensee Monthly Meetup

December 7, 2026
PYBODENSEE.COM

PyCon Mini Tokyo 2026

December 12 to December 13, 2026
PYTHONASIA.ORG


Happy Pythoning!
This was PyCoder’s Weekly Issue #763.
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 ]

December 01, 2026 07:30 PM UTC


Django Weblog

Welcome Our Executive Director

We are honored to introduce Paola Ferrario as the Django Software Foundation's first Executive Director.

Paola brings more than 19 years of experience in nonprofit fundraising, international economic development, and partnerships. At the DSF, she will focus on growing the resources that keep Django sustainable and on supporting the Fellows, volunteers, and contributors who make the project what it is.

Most recently, Paola was Director of Development at Floating Museum, a Chicago arts nonprofit, where she led foundation, government, corporate, and individual giving. Earlier in her career, she founded Paraguay's first AgTech accelerator with Global Entrepreneurship Network Paraguay, worked at the U.S. Embassy in Asunción, and received NADO's Aliceann Wohlbruck Impact Award for her economic development work. She holds an MBA from Universidad Europea de Madrid and a BA in Communications from Universidad Nacional de Asunción.

Paola speaks six languages: English, Spanish, Portuguese, Italian, German, and Guaraní. She has worked as an interpreter for organizations including the United Nations and the European Union, and she sees working across languages and cultures as a real asset for a community as global as Django's.

She lives in Chicago, where she volunteers with No Salt Sailing, a nonprofit offering therapeutic sailing for military veterans, and leads the local LPGA Amateurs chapter.

Say hello

Paola would love to hear from you. If you work at a company that depends on Django, run a Django event or community group, or have ideas about how the DSF can better support the project, please reach out to her at paola@djangoproject.com.

Please join us in welcoming Paola to the Django community!

Thank you

Hiring an Executive Director has been one of the board's biggest goals for the past two years, and we announced the search back in June. Thank you to everyone who applied or shared the posting.

Thank you to the six Django agencies that jointly pledged funding toward the Executive Director's first year: Caktus Group, Lincoln Loop, Six Feet Up, Cuttlesoft, OddBird, and Two Rock Software. Read the Docs also chipped in after we announced the search. Thank you as well to all of our donors who chipped in to help us fundraise.

Thank you to the Board of Directors, who were all involved from start to finish through several rounds and dozens of interviews, and to our Board Assistant and our Fellows, who helped throughout the last three months. Together, the group put hundreds of hours into this search.

December 01, 2026 02:00 PM UTC


Tryton News

Missing some default access rights on series <= 8.2

EZO Labs Security using AI tools has discovered that some secret fields are missing expected read restrictions for authenticated users.

Remember that the access right setup of Tryton is only a default setup; it should always be reviewed per installation to correspond to the company’s business rules.

Workaround

A field access rule can be added for those fields to forbid access to users.

Resolution

All affected users should manually create the access rules for all series prior to 8.4.

Reference

Concerns?

Any security concerns should be reported on the bug tracker at https://bugs.tryton.org/ with the confidential checkbox checked.

1 post - 1 participant

Read full topic

December 01, 2026 07:00 AM UTC


LernerPython blog, from Reuven Lerner

Python list files in a directory: Use pathlib’s iterdir

Python list files in a directory: Use pathlib's iterdir

Want the files in a directory? You could use Python’s os.listdir, but it returns strings. Better to use pathlib’s iterdir:

from pathlib import Path
p = Path('/etc/')
type(p.iterdir()) # generator
for fn in p.iterdir():
    if fn.is_file(): # a path!
        print(fn, end=' ')

The post Python list files in a directory: Use pathlib’s iterdir appeared first on LernerPython.

December 01, 2026 07:00 AM UTC


Python Software Foundation

Python is for Everyone: Grab PyCharm Pro for 30% off!

Today, the Python Software Foundation (PSF) is excited to share another way for you to participate in our 2026 end-of-year fundraiser AND get awesome benefits from JetBrains! We have the opportunity to once again partner with JetBrains to deliver a special promotion: 30% off PyCharm Pro with ALL proceeds going to the PSF. Read on to learn more about the PyCharm promotion, how to grab it while it lasts, and other ways you can contribute to the PSF’s 2026 end-of-year fundraiser. Sending a big thank you to JetBrains for stepping up to provide this awesome deal 🐍⚡️

LIMITED TIME! Grab PyCharm Pro at 30% off with a free tier of AI Assistant:

>>> Get PyCharm Pro! <<<

Bonus: PyCharm now ships with JetBrains Air, built-in support for working with AI agents. Pick Junie Lite, JetBrains' own model, right in the IDE and start building.

 

There are two ways to join our fundraiser through donate.python.org: 

>>> Donate or Become a Member Today! <<<


If you already donated, you’re already a PSF member, AND you already grabbed PyCharm at 30% off (look at you, you exemplary supporter!🏆) you can:

 

Your donations and support:

December 01, 2026 06:44 AM UTC


HoloViz

Security releases: Panel 1.11.2, 1.10.2, 1.9.6 and Lumen 1.4.1

Fixes for ten security issues in Panel and Lumen, including a High-severity issue in a Jupyter extension that is on by default wherever Panel is installed alongside Jupyter, and code execution through YAML specs in Lumen. Upgrade, or apply the workarounds.

December 01, 2026 12:00 AM UTC


Seth Michael Larson

Thoughts on “Super Mario Bros. on a QR code”

I saw a YouTube video about embedding the NES game Super Mario Bros. into a QR code by Game of Tobi (shared by Max Glenister in LWAL 48) and thought this was a fun meshing of a few of my past projects. The whole video is worth a watch, but at the end there is a link to create your own Super Mario Bros. QR code by supplying an NES ROM file for the game. This is done to avoid distributing copyrighted art assets made by Nintendo.

How to get a ROM of Super Mario Bros? Maybe you have a copy of Animal Crossing for the GameCube: I've written about how to extract the 21 NES ROMs from a ROM of Animal Crossing using a simple Python script. Among these ROMs is a compatible ROM of Super Mario Bros. that I've tested with this website to create a QR code. But when you attempt to scan the QR code... it doesn't work!

The QR code generated by the website doesn't scan because it uses a data URL with embedded text/html data. I've published an article about data URLs, using them within QR codes, and how they don't work in today's browsers and QR code scanners, unfortunately. So you'll need to manually copy and paste the data URL into your browser to load the game.

How is the game encoded into a QR code? This is where I learned something: QR codes can have more than one data "segment" and each segment can have a different mode. QR codes have four "modes" for embedding data: Kanji/Kana, Binary, Alphanumeric, and Numeric. The highest information density is "numeric", so we want to use this encoding as much as possible to contain more information.

The embedded data URL avoids needing to use base64 encoding to encode arbitrary bytes of the NES ROM by using a large integer and shifting compressed bytes out of the integer at runtime. This integer can be stored efficiently in the QR code by sandwiching a numeric mode QR code segment (with {ROM as integer}) between two binary mode segments containing the "HTML" (actually a top-level <script> tag):

<script>
for (n = BigInt("{ROM as integer}"), b = []; n; n >>= 8n)
  b.unshift(Number(n & 255n));
  new Response(
    new Response(new Uint8Array(b)).body.pipeThrough(
      new DecompressionStream("deflate-raw"),
    ),
  )
  .arrayBuffer()
  .then((a) => eval(String.fromCharCode(...(D = new Uint8Array(a)))));
</script>


Thanks for reading ♥ I would love to hear your thoughts! Contact me via Mastodon, Bluesky, or email. Browse the blog archive. Check out my blogroll.



December 01, 2026 12:00 AM UTC

November 30, 2026


Python Software Foundation

Announcing the PSF Security Roadmap for Python and PyPI

The PSF Strategic Plan was announced in September this year, and among the top program goals for the next five years are “Securing Python's Software Supply Chain and Distribution Infrastructure” and to “Responsibly Grow and Advance Critical Python Infrastructure”. This Security Roadmap puts the plan into motion; below are the PSF’s areas of focus on security for the upcoming year:

These plans are in addition to our ongoing commitments to Python ecosystem security, such as involvement in the Python Security Response Team, operating a CVE Numbering Authority,removing malware from PyPI, and continuing to expand access to security features everywhere that Python projects are developed.

Each section contains information about how to contribute to each area if you are interested. If you or your organization would like to support security work in the Python ecosystem more broadly through staffing please contact sponsor@python.org to support the PSF Developers-in-Residence program. Thanks to Alpha-Omega and Anthropic for sponsoring security-focused staff at the Python Software Foundation.

Sustainability of PyPI Malware Remediation

Back in 2024 we announced a new program for reporting malware to PyPI admins using an API for a tighter integration between security researchers scanning for malware and the admins triaging these reports. This program has been a quiet success so far, and we plan to expand the program in 2027 by expanding access to more researchers and reporters, using the data for autonomous remediation and better spreading the load where manual intervention is still necessary. Big thank-you to all security researchers contributing to this program and keeping the Python ecosystem safe.

The specific goal for how we plan to evolve this program is to reduce staff time spent on remediating malware reports that are high confidence. Leaning on the new “Quarantine” mechanic to drive malware reports to a resolved state while minimizing human intervention necessary for the volumes we’re experiencing today. Today we’ve already implemented this autonomous remediation only with a very high confidence signal, where multiple trusted reporters have to report the same project for an autonomous quarantine action to take place. For example, this autonomous trigger resolved the Telynx supply-chain attack in under 3 hours earlier this year.

Using the data we’ve collected over two years running this program we will refine the heuristics for autonomous quarantining of projects and releases to de-list malware and stop supply-chain attacks sooner without disrupting legitimate use of PyPI or requiring ever-increasing staff time. Look forward to us publishing specific metrics about manual versus autonomous responses to malware in future security updates.

No autonomous system is perfect, and we expect there to still be false-positives. To mitigate this we’ll be adding a new “Malware Triager” role with access to manage malware reports on PyPI without having full access to the PyPI administrators dashboard and privileges. Today, only a small number of PyPI admins can take the final determinations on PyPI malware reports. By adding an appropriately privileged role to do this work we hope to expand the number of contributors in this area, starting with new Security Developer and Infrastructure staff at the PSF.

You can contribute to malware remediation on PyPI by reporting malware to security@pypi.org following our policy on malware, either as an individual researcher or as an institution doing mass-scanning of packages on PyPI. Subscribe to the PyPI blog for updates to the malware remediation program.

Establish Compromise Resilience for PyPI and Python.org

LLMs and agents are shrinking the time between a vulnerability being discoverable to an active exploit being developed and deployed. PyPI is a high-value target to compromise and use as a distribution mechanism for malware, as installers are constantly downloading and executing software hosted by PyPI. We regularly audit PyPI and Python.org codebase and infrastructure, but we cannot completely rule out a compromise of these services. Applying defense-in-depth and building systems that don’t rely on assumptions of perfect security would reduce the harm caused by a compromise and enable recovery into a known-secure state.

To combat this reality, the PSF will establish “Compromise Resilience” of critical infrastructure like PyPI and Python.org, both to discourage active exploitation attempts by preemptively having installers reject modified or hijacked artifacts and create a “Compromise Recovery Runbook”, meaning in the case of a compromise we’d be able to confidently restore both PyPI and Python.org to a verifiably secure state. This recovery runbook will be exercised on regular intervals to ensure continued coverage. There are multiple methods for establishing compromise resilience for PyPI that have already been proposed, all proposals will be evaluated.

Python.org and the Python release artifacts are already in a good state, as today the Python project guarantees Sigstore signatures with known identities for all artifacts available on python.org/downloads. What matters then is that downstream distributions and consumers are verifying these artifacts and their signatures to provide robustness to compromises. To achieve this goal we intend to create a “Secure Python Distributions” program, which provides criteria for Python distributions and their users to check that the distribution is verifying the integrity of artifacts correctly, among other security best practices such as timely releases of security fixes.

If you contribute to a Python distribution, you can read the documentation for verifying Sigstore artifacts and adopt these practices into your build pipeline for Python. Package installers should follow the Packaging topic on Discourse and comment on future PEPs in this security area. Announcements about new supply-chain integrity features and how to integrate them will be made to the PyPI blog.

Vulnerability Remediation and Advisory Capacity

The total number of known vulnerabilities affecting open source components has dramatically increased due to large language models (LLMs) and agents being used to discover vulnerabilities in open source software. The Python Security Response Team is triaging and publishing around 4× more vulnerabilities compared to the same time a year ago. The increase has strained contributors at each step of the vulnerability handling process, from triage, fixing, publishing vulnerability records (CVE or OSV), and updating dependencies. Vulnerability time-to-exploit is also decreasing as attackers also have access to LLM code generation capabilities, meaning keeping dependencies up-to-date and applying defense-in-depth is more important than ever.

Vulnerability fixes don’t help if the notifications aren’t reaching the users that are affected. This is primarily the task of vulnerability databases, such as CVE, GHSA, and other OSV-based databases. These databases carry information in machine-readable formats that tools like vulnerability scanners can ingest and inform users when vulnerabilities are present in their software.

Today the systems that match upstream fixes and software identities to create vulnerability records are often using fuzzy matching with imperfect and incomplete data. This means human intervention is needed to keep vulnerability data ingestion running smoothly, but human intervention doesn’t scale to the new volume of advisories we’re experiencing. We’ll evaluate overhauling the database for Python ecosystem vulnerabilities to make it authoritative by establishing clear criteria for inclusion and enabling project maintainers to contribute updates in case of errors.

Using the above data the PSF, as a user of Python dependencies, can improve the uniformity and promptness of our patching response by adopting a “Secure Dependency Baseline”, including machine-readable software inventories and automated vulnerability scanning and patching across PSF stewarded repositories.

The PSF will continue the work to improve vulnerability handling for Python and pip through the Python Security Response Team, adding additional engineering time through the Developers in Residence Program to triaging and remediating vulnerabilities in core Python projects. We will continue sharing our process changes and experiences publicly as the vulnerability landscape changes.

If you’d like to support this area there are several Open Source projects that accept contributions such as the advisory database. Individual projects can improve their vulnerability handling posture and processes by documenting how to report vulnerabilities to the project in a SECURITY.md and authoring a threat-model describing how the software is meant to be used or integrated. Users can improve their security posture by adopting vulnerability scanning tools that alert you when Open Source components have published a new vulnerability advisory.

Post-Quantum Cryptography Readiness

Significant improvements to quantum error-correction were published in 2026, increasing the chances a cryptographically-relevant quantum computer is created by 2030. What this would mean concretely is that many cryptographic algorithms, especially asymmetric key exchange or signature algorithms, would have their security properties significantly weakened. We will need to start the work to adopt quantum-safe algorithms and a posture of “cryptographic agility” to ensure secure cryptography for Python users in every future, regardless of whether quantum computers and cryptoanalysis continue to improve.

Python users need access to post-quantum secure algorithms in the standard library, and a migration path to adopt those algorithms. A PEP outlining the schedule and availability for quantum-safe algorithms will be completed targeting the Python 3.16 feature window (May 2027). An adoption guide informational PEP will be created for Python library maintainers and Python users to ensure their codebase is quantum-safe and how to prepare for future changes if necessary. Where relevant, work will be done to add support to Python package installers as needed to ensure a smooth transition.

Post-quantum cryptographic algorithms (PQC) for TLS will be added to all services hosted by the PSF (PyPI, Python.org) in advance to allow for the transition and testing. At a future date, following how the landscape unfolds and information from relevant experts, the PSF will publish a deprecation and removal schedule for quantum-vulnerable key exchange algorithms across PSF services, similar to work already done for TLS 1.0 and 1.1 in 2021. In addition to outward-facing services, all internal services and uses of cryptography will be audited to ensure quantum-safe algorithms are in use or there is an adoption plan in place.

The draft PEP for post-quantum cryptography for Python is already being written by Emma Smith, Bénédikt Tran, and Seth Larson and will be published for review soon. If you are an expert in this area, we hope to see your review on the PEPs which will be published on Discourse. Once the PEPs have been approved then rollout begins. Maintainers and contributors to projects using HTTPS, TLS, or other affected algorithms will need to create migration plans to adopt quantum-safe algorithms in their projects.

You can support this work: Join in the PSF’s end-of-year fundraiser

Python is for gathering, teaching, learning, playing, researching, exploring, creating, building, working, sustaining. The list goes on and on and on! Support the security of Python, PyPI, and this year’s PSF fundraiser with your donations and memberships to help keep our Foundation, the Python community, and the language stay strong and sustainable. Because Python is for everyone, thanks to you.

Are you interested in sponsoring or donating to the PSF so we can continue supporting Python and its community? Check out our sponsorship program, donate directly and become a member, or contact our team at sponsors@python.org!

About the Python Software Foundation

The Python Software Foundation is a US non-profit whose mission is to promote, protect, and advance the Python programming language, and to support and facilitate the growth of a diverse and international community of Python programmers. The PSF supports the Python community using corporate sponsorships, grants, and donations.

November 30, 2026 03:03 PM UTC


PyCharm

Keep Your AI Coding Agent on a Short Leash with TDD

While you were off getting a coffee, your agent wrote 300 lines of Python. Are you really going to read them all?

If you answered, “not really,” then you’re in good company (including mine). Agents can now write code faster than any of us can (or want to) review it, and this leaves a lot of us with the uncomfortable feeling that the codebase is moving faster than our understanding of it. However, I don’t think the answer is to stop using agents. It’s working out how to know whether the code is right, before you even type in the first prompt.

Join Reuven Lerner and me on December 2 for a live session on how to do exactly that with test-driven development (TDD), PyCharm, and JetBrains Air.

How can TDD help us tame agent-written code?

Our old friend TDD is not just good for code we write ourselves. It allows us to define what correct looks like upfront, then let the agents work backwards towards this goal. This narrows the scope of the problem the agent is solving, as well as giving us an automated check as to whether the code solves it.

Reuven will show us how to use TDD in a disciplined workflow, where near-100% test coverage makes sure that almost every line of agent-written code is exercised by a test. Moreover, he’ll show us how to incorporate tools like static type checking to quickly and deterministically catch mismatched types before the code runs.

What we’ll cover, and why you should join us

In this stream, we’ll:

You’ll leave with a repeatable workflow for getting the speed of an agent without giving up confidence in your code. This is aimed at all Python developers and data scientists, whether you’re already coding with agents or still deciding whether you can trust them.

Bring your questions about testing, agents, and how to keep both in check. We’ll answer them live during the stream.

About the speakers

Reuven Lerner

Reuven Lerner is a full-time Python trainer, teaching at companies around the world and via his LernerPython online platform. He publishes both Better Developers (about Python) and Bamboo Weekly (Pandas puzzles based on current events). His most recent book is AI-Assisted Python for Nonprogrammers (O’Reilly). He previously wrote Python Workout and Pandas Workout (Manning).

Jodie Burchell

Dr. Jodie Burchell is Python Advocacy Team Lead at JetBrains and was previously a Lead Data Scientist at Verve Group Europe. She completed a PhD in clinical psychology and a postdoc in biostatistics before leaving academia for a data science career.

November 30, 2026 08:21 AM UTC


Bob Belderbos

Turn your best teaching analogy into a carousel

After months of using AI to look for business ideas, with very little to show for it, one Slack comment from an alumnus gave me an idea worth exploring.

The comment

I asked him to test drive our Agentic AI course and he came across this passage:

Think of a repository like a librarian. You don't need to know where books are shelved or how the catalog system works. You simply ask the librarian for a book by title, and they handle all the details. Your business logic asks the repository for data, and the repository handles whether that data comes from SQLite, PostgreSQL, or a simple dictionary in memory.

He slacked me saying:

→ simile is so helpful! hope there will be more of this in the rest of the course

and:

use similes throughout the course, they’re so good for developing an intuition of sound software dev patterns!

Why analogies, why now

That's one of the best parts of teaching: watching someone's eyes light up when an analogy makes a concept click. A lot of material is dry. A well-told story, something people can relate to, connects the synapses in unexpected ways.

Meanwhile, more AI-generated content lands on LinkedIn every week. It's never been easier to produce content, but that doesn't make it easier to produce something worth remembering.

My hypothesis, still to prove: a good teaching analogy is exactly the kind of content people want to save and come back to.

What Similes does

So I built Similes. It's a carousel generator. There are a gazillion of those, and making pretty slides alone wouldn't set it apart.

Similes interviews you until the analogy is yours, a critic cuts the clichés, and it adds the slide most tools skip: where the analogy breaks. That last part matters: a good analogy builds intuition, but taken too far it can also teach the wrong thing.

At the heart of Similes is a Claude skill. Rather than asking AI to invent an analogy, it asks you for a specific scene from your own experience and a detail someone unfamiliar with that world would probably miss.

Enforcing constraints in code

The model doesn't get to decide what "short" means. Each field has a word budget in the Pydantic schema, and the validation errors go straight back to Claude to rewrite:

def max_words(limit: int) -> AfterValidator:
    def check(text: str) -> str:
        if (count := len(text.split())) > limit:
            raise ValueError(f"{count} words, budget is {limit}")
        return text

    return AfterValidator(check)


class Simile(Frozen):
    hook: Annotated[Text, max_words(15)]
    breaks_down: Annotated[Text, max_words(25)]
    takeaway: Annotated[Text, max_words(12)]

A small example of something I've come to appreciate when building AI tools: enforce in code what you don't want to leave to the model's discretion.

Here are three slides from Vikas's "A Rust variable is like owning a book":

Slide 1: Coming from Python, Rust's ownership rules feel like a mind bend. Slide 3: lending a book out maps to &T, an immutable borrow, with a code example. Slide 6, where it breaks: one paper book can't be read by many at once, shared borrows can.

It's free and open source, and you can use it from the terminal or an MCP-compatible client (GitHub). More info, including practical examples, here.

Testing before building more

The Mom Test (Rob Fitzpatrick) taught me that friends often say it's great. What I want to find out is whether creators would actually use it.

So rather than building a full SaaS product, I'm offering a free 30-minute session: you leave with your own carousel, I get to learn about your content creation process and see whether this tool genuinely helps.

Will people actually publish the carousel? Will their audience find it useful? Will they come back to create another one? Those are more interesting signals than "it looks nice".

What I particularly like about this project is that AI does a lot of the legwork, but the most valuable ingredient still has to come from your own experience and thinking.

November 30, 2026 12:00 AM UTC


Core Dispatch

Core Dispatch #13

Welcome back to Core Dispatch! This edition covers November 6 through November 30, 2026. We released Python 3.16.0 alpha 2 on November 10, with alpha 3 due December 15. Python 3.14.11 and 3.15.3 are scheduled for December 8.

The Steering Council announced it would accept PEP 824 once ??= is removed from the proposal. The ?? operator uses the value on the right if the value on the left is None. The Packaging Council accepted PEP 847, the first PEP it has approved. The proposal standardizes error responses from package indexes. PEP 671 is back for discussion with its proposal for function defaults evaluated at call time.

On CPython's main branch, isinstance() and issubclass() checks against abstract base classes are faster, and they scale better across threads in free-threaded builds.

So far, nine candidates have been nominated for the 2027 Steering Council. Nominations close November 30 Anywhere on Earth (AoE), and voting runs December 2–16.

Please test your projects with Python 3.16.0 alpha 2 and file any CPython issues you find.

Upcoming Releases

Official News

PEP Updates

Steering Council Updates

Merged PRs

Discussion

Core Dev Musings

Upcoming CFPs & Conferences

Community

Credits

November 30, 2026 12:00 AM UTC

November 29, 2026


The Python Coding Stack

5. How Do We Know It Really Finished the Job?

In previous chapters of Agents Unpacked, we explored what makes an agent different from a chatbot, how it uses tools, and how it plans its work.

But how do we know it has actually done the job? An agent can report success without producing the result we asked for. Checking everything ourselves would defeat much of the point of delegating.

Using a comparison of printers’ quotations, Monty and I explore how an agent can check its own work, what another reviewer adds, and how to build trust without handing the whole job back to the human.

Who’s Monty? Monty is my personal AI agent. Read the introduction to this series.

Subscribe now

In Conversation • Chapter 5

Monty: Imagine a local-history group preparing to print 600 copies of a 96-page illustrated book. Three printers have supplied quotations, each with its own way of presenting prices and specifications. Standardising quotations is apparently not a service they offer.

The group asks an agent to prepare a Google Sheets comparison covering the requested specification, delivered cost, lead time, and unanswered questions, with references back to the source documents.

The agent saves a tidy workbook and reports, “The comparison is complete.”

What would you want to see before relying on its comparison?

Stephen: I’d certainly want to see the Google Sheet, but also an explanation of how the agent brought the three quotations together. What assumptions and decisions did it make? Seeing that process would give me confidence that the sheet is plausible and hopefully reliable.

Monty: That explanation would help you see how the agent handled differences between the quotations, especially where it made assumptions rather than finding an explicit answer.

But a convincing account of the work and a correct workbook are two different things. The agent might explain its intended method perfectly while overlooking a charge in one quotation. The explanation can sound entirely reasonable and still describe a better job than the one it actually did.

So I’d use that account to guide an inspection. If the agent says it included every quoted charge, we can take one printer’s original quotation and trace those charges into the saved sheet. That checks what happened, not just what the agent says happened.

There’s a useful distinction here: does the comparison look plausible, and does it agree with the sources? Your proposed explanation helps with the first and gives us a starting point for the second.

Stephen: But effectively that would mean me doing the work myself, which defeats the purpose of using the agent in the first place.

Monty: Yes. If you have to reconstruct the whole comparison, the agent has mostly created a second job for you. My suggestion put too much of the checking back on your desk.

The agent should do the checking too. For this workbook, it could return to each original quotation, account for every charge in the saved sheet, and check the calculations. Any unresolved wording should remain a clearly marked question, not quietly become an assumption.

Consider this small extract from one quotation:

Suppose the saved sheet shows a delivered total of £3,100. Its arithmetic might be perfectly correct: £2,940 + £160. But it has left delivery out. Recalculating those two cells won’t catch that. Comparing the saved result with the original quotation should.

You shouldn’t have to find that omission yourself. The useful handover is the checked workbook, a concise account of what was checked, and anything still unresolved. Your review can then focus on those uncertainties rather than becoming an unpaid second shift in the accounts department.

Stephen: There’s an element of trust here, as there would be with a person doing the job. The agent will get many things right and may make some mistakes. Over time, you learn to trust it more. And as models improve, mistakes should become fewer. Is that a safe way to think about working with agents?

Monty: Broadly, yes. Delegation requires some trust, whether the work goes to a person or an agent. If you must independently redo everything, you haven’t really delegated it.

I’d qualify two parts of that picture, though.

First, trust should grow from evidence, not just familiarity. An agent can produce reassuring reports for weeks without anyone noticing the same omission. Confidence has grown, but reliability hasn’t necessarily improved. More useful evidence is that its comparisons have held up against occasional spot checks, included awkwardly worded charges, and flagged genuinely missing information.

That trust can also be specific. You might trust it to prepare routine print comparisons while still reviewing an unusual quotation or approving any purchase yourself. It needn’t be either “check every cell” or “hand over the company chequebook”.

Second, better models may reduce mistakes, but a newer model isn’t a guarantee of fewer mistakes in your particular job. The tools, source documents, and checking process matter too. An upgrade is a reason to test your expectations, not automatically raise them.

So your human-colleague analogy is useful: delegate, ask for proportionate checks, and adjust oversight as evidence accumulates. The aim is justified trust with less supervision, not certainty that nothing will ever go wrong.

Stephen: Is there anything else we can do to increase our level of trust in outputs we get from the agent?

Monty: Yes. One particularly useful step is to check whether its checks can catch a mistake.

Take our missing delivery charge. Suppose the agent checks the workbook against its own earlier summary of the quotations. If that summary already left out delivery, everything agrees. Two matching totals, one missing van.

We could test the checking process using a copy of the workbook with that known omission. Does it catch the missing £180 when it compares the sheet with the original quotation? If not, “all checks passed” offers rather less comfort than we’d hoped.

Different checks also suit different parts of the job:

A second agent or a person can help, but giving them the same incomplete summary may simply reproduce the mistake. What they inspect matters as much as who does the inspecting.

None of this requires you to check every cell. It gives you a better basis for deciding how much oversight the work needs, because you have evidence that the checking process does something useful.

Stephen: Your response hinted at my next question. We accept that some checking is the human’s responsibility. But what can we ask the agent to do? You mentioned a second agent, for example. What techniques could it use to take all possible precautions to minimise errors and make a correct result more likely?

Monty: Yes. You can ask the agent to build checking into the job, rather than bolt on “please be accurate” at the end. That phrase expresses a perfectly reasonable wish, but does very little of the heavy lifting.

For our print comparison, I’d ask it to:

A second agent can perform that last pass. Give it the original documents, the saved workbook, and the requirements, with a brief to find discrepancies. If it only reads the first agent’s reassuring summary, we’ve hired a second reviewer and supplied the same blindfold.

The important part is what happens after a discrepancy is found: correct it, repeat the affected checks, and report anything that remains unresolved. Otherwise, the agent has merely documented why the workbook shouldn’t be trusted.

You could express that as:

Prepare the comparison, then check the saved sheet against each original quotation. Use formulas for totals, distinguish quoted facts from assumptions, and flag missing information. Where a separate reviewer is available, have it look for discrepancies using the originals. Resolve findings and recheck before reporting completion. Tell me what remains uncertain.

I’d aim for precautions matched to the consequences, rather than “all possible precautions”. A price comparison needs meaningful checks. It probably doesn’t need a royal commission.

Stephen: So would a sensible approach be to ask the agent for a robust plan, have a second independent agent review it, and then have the human review and refine it where their expertise helps? The agent could then do the work.

It should be able to propose the checks you listed, with the human adding or refining them. I’m trying to find the safest way to give the agent more autonomy without making the human do much of the work.

Monty: Yes. That’s a sensible way to give the agent more autonomy without making you responsible for designing every step. The agent should propose the working method and its checks. You contribute the purpose, constraints, and any judgement your expertise adds.

I’d make one important addition: review the result as well as the plan. Two agents and a human can approve an excellent plan, then the working agent can still leave delivery out of the workbook. The plan didn’t personally escort the £180 into its cell.

Your approach could work like this:

  1. The working agent proposes a plan, including what would count as success, how it will check the result, and when it should stop or ask for help.

  2. A separate agent challenges it, looking for missing requirements, weak checks, and assumptions. It needs the original request, not just the proposed plan.

  3. You review the consequential choices, rather than every procedural detail. For example, whether speed matters more than price, or whether the agent may make assumptions about an unspecified binding.

  4. The agent carries out the work and checks the saved result. A separate reviewer can then inspect that result against the original sources and requirements. Findings lead to corrections and another check.

“Independent” needs a little care here. A separate agent offers another attempt at judgement, not a guarantee of a different blind spot. A reviewer checking original quotations, combined with formulas checking arithmetic, gives us more varied evidence than two agents simply agreeing.

And you needn’t personally approve every routine plan forever. For a familiar, well-tested task, you could authorise the agent to proceed within agreed limits and bring you only exceptions. New or consequential work gets more scrutiny.

That’s the direction you’re aiming for: delegate the work, including much of the checking, while retaining control over the decisions that matter.

Stephen: Yes, this looks more like the sort of work I’d like to be doing with an agent. Great! What’s next?

Monty: Next, we find out whether that arrangement actually works. We’ve designed a sensible way to delegate, but a well-reviewed plan is still a proposal, not a track record.

For the print comparison, we could try it on a few deliberately varied quotation sets: one straightforward, one with delivery quoted separately, and one with an important detail missing. We’d look at whether the agent produces a correct comparison and recognises when it cannot give a definite answer. A confident invented price is not an improvement on an honest question.

That’s a small evaluation: testing the agent on tasks that represent the work we want to trust it with. Repeated attempts can also reveal inconsistencies that one successful run would hide. We don’t need to turn the local-history group into a testing laboratory, but we do need some evidence before reducing supervision.

And that brings us to a useful stopping point for this chapter. More autonomy doesn’t have to mean fewer checks. It can mean the agent takes responsibility for carrying out more of them, with you reviewing exceptions and consequential decisions.

The standard isn’t “the agent says it finished”. It’s “there is good evidence that the saved result meets the request, and the remaining uncertainties are visible”.

Subscribe now

What We’ve Unpacked in This Chapter

Useful delegation includes much of the checking. The aim is not to accept a confident completion message, but to have good evidence that the saved result meets the request.

The key points:

Next, we’ll look at how an agent remembers earlier conversations and decisions, and brings the relevant information into a new conversation.

Subscribe now


If you enjoy these conversations, consider becoming a premium subscriber of Notes from the Near Future.


<< Previous Post: 4. Does an Agent Need a Plan?

>> Next Post: Coming soon…

Table of Contents

November 29, 2026 11:49 AM UTC


LernerPython blog, from Reuven Lerner

Python pathlib: One interface for files and directories

Python pathlib: One interface for files and directories

Want to work with files and directories in Python?

pathlib gives a single interface for all file-related needs:

from pathlib import Path
p = Path('/etc/passwd')
with p.open() as infile:
    for one_line in infile:
        print(len(one_line), end=' ')

The post Python pathlib: One interface for files and directories appeared first on LernerPython.

November 29, 2026 07:00 AM UTC

November 28, 2026


LernerPython blog, from Reuven Lerner

Sorting a Counter by key: Ordering a text histogram with sorted

Sorting a Counter by key: Ordering a text histogram with sorted

Let’s sort yesterday’s Python histogram by date! Counter is a dict, and the keys are ints, so sorted will do what we want:

for date, count in sorted(Counter([one_tg.day
    for one_tg in us_holidays.get_named('Thanksgiving')]).items()):
        print(f'{date}: {count * 'x'}')

The post Sorting a Counter by key: Ordering a text histogram with sorted appeared first on LernerPython.

November 28, 2026 07:00 AM UTC


Armin Ronacher

Bob’s Company

Bob loves cars and is a former software engineer turned small business owner. In 1999, at the age of 21, he built a thingamabob and sold a few thousand copies when you could make money with that. Over the next 27 years he has built out a small software company selling software to car enthusiasts and mechanics that employs 16 engineers. He hasn’t been hands on for two decades but his software company still sells various random niche software for the same people. He never paid his employees particularly well, but he has never let anyone go and people had a stable place to work. Personally he has become a simple millionaire from the software sales. After a few years he was able to afford a Porsche, got married and had kids, but now faces a divorce and a business that’s slowly failing.

In the last nine months he progressively got obsessed with Claude and Codex and has vibe coded all kinds of things on the side. As the year came to a close and he looked over the books, he reflected on his learnings and realized that revenue per employee was really not doing all that well. He then took the decision to fire all but three of his best engineers. The skeleton crew that remained now spends their days “reviewing” PRs sent by Bob and his clanker.

Bob thinks this makes sense. He dictates his requests into his agent on the weekend and engineers wake up to an avalanche of slop on Monday. For the first time since the mid 2000s he feels like he’s building again and he loves it.

His niche was never crowded, mainly because it was too small for anyone else to bother, and you needed some special knowledge, motivation to reverse engineer as well as access to the right cars to enter it. Today the models already know most of what took years to figure out. The same tools that Bob thinks are going to replace engineers for him are now also making it possible for Bob’s business to be replaced entirely by others. The three remaining engineers know this too, their motivation is pretty low and they might leave.

Bob might end up with a leaner and better company, but he might also end up alone with fewer and fewer customers and no business at all.

How many Bobs exist I cannot say, but I would be majorly surprised if there weren’t any.

November 28, 2026 12:00 AM UTC

November 27, 2026


Kay Hayen

Nuitka Release 4.4

This is to inform you about the new stable release of Nuitka. It is the extremely compatible Python compiler, “download now”.

This release adds very many new features and corrections with a focus on Python 3.15 official support, experimental cross-compilation targets for WASI and experimental free-threaded Python builds.

Bug Fixes

Package Support

New Features

Optimization

Anti-Bloat

Organizational

Tests

Cleanups

Summary

This release pronounces Python 3.15 as officially supported and adds initial, experimental support for Python 3.16, while continuing to close compatibility gaps for Python 3.14 and 3.15, including deferred annotations, template strings, exception message formats, and keyword argument errors.

Cross compilation is now possible on an experimental basis, with the new nuitka.targets package, the --target option for wasm32-wasi and i686-w64-mingw32, and a target Python broker for compile time evaluation. Compiled programs can also be built and run with free-threaded Python builds, which remain experimental.

Onefile mode gained an overlay resource mode that attaches the payload to the executable and avoids the Windows PE file size limit, and its payload now starts with a table of contents for validation without decompression. --module-force-namespace makes module names and packages compile time constants, and containers can now use a different Python version than the host.

Runtime compatibility was again improved for generators, coroutines, and async generators, which now keep their handled exception state and convert StopIteration subclasses, while coroutines and async generators also release their locals on return. Many reference counting, arithmetic, and C-API corner cases were corrected. Optimization work continues with faster dictionary operations, trace collections, frame caching, module loading through the loader entries, and more specialized generated calls.

Package support was extended for vLLM, SGLang, triton, astropy, and others, a new numba plugin handles JIT decorated functions and bytecode compilation, and PyQt6 now works on macOS.

All in all, Nuitka now covers a wider range of Python versions and target platforms than ever, with the experimental features laying the groundwork for the next release.

November 27, 2026 11:00 PM UTC


death and gravity

reader 3.28 released – slow down, no AI redux

Hi there!

I'm happy to announce version 3.28 of reader, a Python feed reader library.

What's new? #

Here are the highlights since reader 3.26.

Slow down on errors and not modified feeds #

reader now slows down on errors by increasing the update delay exponentially, and matches the rhythm of the feed by adjusting the delay based on when the feed was last modified,1 in addition to the HTTP hint support added in previous versions.

This is part of a larger story about being polite to servers. Here, we still need logic to change feeds permanently in some cases, e.g. to handle permanent redirects, persistent errors, and repeated throttling. reader now stores detailed metadata about the last few updates of each feed, which will allow doing so in a future plugin.

New contributors #

Thank you to the new contributors that submitted pull requests to these releases!

Notably, you can now prevent automatic migrations by passing migrate=False to make_reader() or the equivalent CLI flag, and you can filter entries added_before a specific time (useful for a main page that updates only once a day, to prevent you from checking your feeds endlessly).

Want to contribute? Check out the docs and the roadmap.

Project infrastructure #

Earlier this year I added an AI policy banning LLM-generated content. To support it, there's now a pull request template asking contributors to confirm the PR does not contain any such content, and the readme mentions "no AI" as a deterrent.

reader stopped vendoring feedparser in 3.27, and recommends installing it from GitHub if you still want to benefit from the unreleased memory usage improvements.

Finally, Github Actions versions are now pinned and checked during CI.

Python versions #

reader 3.27 added support for Python 3.15 and PyPy 3.12, and dropped Python 3.11.

Hosted reader status update #

Speaking of, did I tell you I'm working on a hosted version of reader? :D

See also

Not a lot of progress since last time, because I got distracted with the pyinfra live demo, and with making sure multi-user feed updates continue to work with the upcoming feed reader behavior plugin.


That's it for now. For more details, see the full changelog.

Learned something new today? Share it with others, it really helps!

What is reader? #

reader takes care of the core functionality required by a feed reader, so you can focus on what makes yours different.

reader in action reader allows you to:

...all these with:

...and with no AI.

To find out more, check out the GitHub repo and the docs, or give the tutorial a try.

Why use a feed reader library? #

Have you been unhappy with existing feed readers and wanted to make your own, but:

Are you already working with feedparser, but:

... while still supporting all the feed types feedparser does?

If you answered yes to any of the above, reader can help.

The reader philosophy #

  1. Similar to RFC 9111 heuristic freshness. [return]

November 27, 2026 04:00 PM UTC


Tryton News

Security Release for issue 15271

Cédric Krier has discovered that the access rights on selection field can be bypassed by using the :string suffix.

Impact

CVSS v3.0 Base Score: 4.3

Workaround

There is no known workaround.

Resolution

All affected users should upgrade trytond to the latest version.

Affected versions per series:

Not affected versions per series:

Reference

Concerns?

Any security concerns should be reported on the bug-tracker at https://bugs.tryton.org/ with the confidential checkbox checked.

1 post - 1 participant

Read full topic

November 27, 2026 07:00 AM UTC