Issue #763

K-Means Clustering, Advent of Code Prep, TypedDict, and More

Dec. 1, 2026

K-Means Clustering, Advent of Code Prep, TypedDict, and More
#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
POSITsponsor

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


Brought to you by Real Pythonsponsor
Online Python Training Created by Experts →

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

📆🐍 Upcoming Python Events


Weekly Real Python Office Hours Q&A (Virtual)
December 2, 2026

Canberra Python Meetup
December 3, 2026

Sydney Python User Group (SyPy)
December 3, 2026

Melbourne Python Users Group, Australia
December 7, 2026

PyBodensee Monthly Meetup
December 7, 2026

PyCon Mini Tokyo 2026
December 12 to December 13, 2026
Happy Pythoning!
Copyright © 2026 PyCoder’s Weekly, All rights reserved.