skip to navigation
skip to content

Planet Python

Last update: November 29, 2025 04:44 AM UTC

November 29, 2025


Zero to Mastery

[November 2025] Python Monthly Newsletter 🐍

72nd issue of Andrei's Python Monthly: uv is the Future, Python Hyperflask, Python 3.14 is here, and much more. Read the full newsletter to get up-to-date with everything you need to know from last month.

November 29, 2025 04:43 AM UTC

November 28, 2025


death and gravity

reader 3.20 released – we're so back

November 28, 2025 09:43 PM UTC


Django Weblog

2026 DSF Board Election Results

The 2026 DSF Board Election has closed, and the following candidates have been elected:

They will all serve two years for their term.

2026 Board

Directors elected for the 2025 DSF Board - Abigail Gbadago, Jeff Triplett, Paolo Melchiorre, Tom Carrick - are continuing with one year left to serve on the board.

Therefore, the combined 2026 DSF Board of Directors are:

* Elected to a two year term

2026 DSF Board: Abigail Gbadago, Jacob Kaplan-Moss, Jeff Triplett, Paolo Melchiorre, Priya Pahwa, Ryan Cheley, Tom Carrick

Congratulations to our winners, and a huge thank you to our departing board members Sarah Abderemane and Thibaud Colas.

Thank you again to everyone who nominated themselves. Even if you were not successful, you gave our community the chance to make their voices heard in who they wanted to represent them.

November 28, 2025 06:15 AM UTC

November 27, 2025


Python GUIs

Getting Started With NiceGUI for Web UI Development in Python — Your First Steps With the NiceGUI Library for Web UI Development

NiceGUI is a Python library that allows developers to create interactive web applications with minimal effort. It's intuitive and easy to use. It provides a high-level interface to build modern web-based graphical user interfaces (GUIs) without requiring deep knowledge of web technologies like HTML, CSS, or JavaScript.

November 27, 2025 06:00 AM UTC

November 26, 2025


Real Python

How to Convert Bytes to Strings in Python

Turn Python bytes to strings, pick the right encoding, and validate results with clear error handling strategies.

November 26, 2025 02:00 PM UTC

November 25, 2025


PyCoder’s Weekly

Issue #710: FastAPI, Floodfill, 20 Years of Django, and More (Nov. 25, 2025)

November 25, 2025 07:30 PM UTC


Real Python

Getting Started With Claude Code

Learn to set up and use Claude Code for Python projects: install, run commands, and integrate with Git.

November 25, 2025 02:00 PM UTC


Python Software Foundation

PSF Code of Conduct Working Group Shares First Transparency Report

November 25, 2025 01:51 PM UTC


HoloViz

Rich parameters & reactive programming with Param: 2.3 release

Release announcement for Param 2.3, including improved docstrings, two new Parameter attributes default_factory and metadata, the new ParameterizedABC abstract base class, and more!

November 25, 2025 12:00 AM UTC


Brian Okken

PythonTest Black Friday Deals 2025

Save up to 50% on courses and the pytest book.

The Complete pytest Course bundle

Use BLACKFRIDAY to save 20% off through November.

This code is intended to match lots of 10-20% off deals around

Use SAVE50 to save 50% off through November

This code is intended to match the PragProg deal below

Why leave both in place?

No reason, really. I just thought it’d be fun to have a “choose your own discount” thing.

November 25, 2025 12:00 AM UTC


Seth Michael Larson

WebKit browsers see telephone numbers everywhere

November 25, 2025 12:00 AM UTC

November 24, 2025


Rodrigo GirĂŁo SerrĂŁo

Generalising itertools.pairwise

In this article you will learn about itertools.pairwise, how to use it, and how to generalise it.

In this tutorial you will learn to use and generalise itertools.pairwise. You will understand what itertools.pairwise does, how to use it, and how to implement a generalised version for when itertools.pairwise isn't enough.

itertools.pairwise

itertools.pairwise is an iterable from the standard module itertools that lets you access overlapping pairs of consecutive elements of the input iterable. That's quite a mouthful, so let me translate:

You give pairwise an iterable, like "ABCD", and pairwise gives you pairs back, like ("A", "B"), ("B", "C"), and ("C", "D").

In loops, it is common to unpack the pairs directly to perform some operation on both values. The example below uses pairwise to determine how the balance of a bank account changed based on the balance history:

from itertools import pairwise  # Python 3.10+

balance_history = [700, 1000, 800, 750]

for before, after in pairwise(balance_history):
    change = after - before
    print(f"Balance changed by {change:+}.")
Balance changed by +300.
Balance changed by -200.
Balance changed by -50.

How to implement pairwise

If you had to implement pairwise, you might think of something like the code below:

def my_pairwise(iterable):
    for prev_, next_ in zip(iterable, iterable[1:]):
        yield (prev_, next_)

Which directly translates to

def my_pairwise(iterable):
    yield from zip(iterable, iterable[1:])

But there is a problem with this implementation, and that is the slicing operation. pairwise is supposed to work with any iterable and not all iterables are sliceable. For example, files are iterables but are not sliceable.

There are a couple of different ways to fix this but my favourite uses collections.deque with its parameter maxlen:

from collections import deque
from itertools import islice

def my_pairwise(data):
    data = iter(data)
    window = deque(islice(data, 1), maxlen=2)
    for value in data:
        window.append(value)
        yield tuple(window)

Generalising itertools.pairwise

pairwise will always produce pairs of consecutive elements, but sometimes you might want tuples of different sizes. For example, you might want something like “triplewise”, to get triples of consecutive elements, but pairwise can't be used for that. So, how do you implement that generalisation?

In the upcoming subsections I will present different ways of implementing the function nwise(iterable, n) that accepts an iterable and a positive integer n and produces overlapping tuples of n elements taken from the given iterable.

Some example applications:

nwise("ABCD", 2) -> ("A", "B"), ("B", "C"), ("C", "D")
nwise("ABCD", 3) -> ("A", "B", "C"), ("B", "C", "D")
nwise("ABCD", 4) -> ("A", "B", "C", "D")

Using deque

The implementation of pairwise that I showed above can be adapted for nwise:

from collections import deque
from itertools import islice

def nwise(iterable, n):
    iterable = iter(iterable)
    window = deque(islice(iterable, n - 1), maxlen=n)
    for value in iterable:
        window.append(value)
        yield tuple(window)

Note that you have to change maxlen=2 to maxlen=n, but also islice(iterable, 1) to islice(iterable, n - 1).

Using tee

Another fundamentally different way of implement nwise is by using itertools.tee to split the input...

November 24, 2025 06:36 PM UTC


EuroPython Society

New EuroPython Society Fellow in 2025

A warm welcome to Martin Borus as the second elected EuroPython Society Fellow in 2025.

EuroPython Society Fellows

EuroPython Society Fellows have contributed significantly towards our mission, the EuroPython conference and the Society as an organisation. They are eligible for a lifetime free attendance of the EuroPython conference and will

November 24, 2025 05:58 PM UTC


Trey Hunner

Python Black Friday & Cyber Monday sales (2025)

November 24, 2025 04:00 PM UTC


Nicola Iarocci

Flask started as an April Fool's joke

The story that the Python micro web framework Flask started as an April Fool’s joke is well known in Python circles, but it was nice to see it told by Armin Ronacher himself1.

I’m fond of Flask. It was a breath of fresh air when it came out, and most of my Python open-source work is based on it.


  1. The video is produced by the people who also authored the remarkable Python: The Documentary↩︎

November 24, 2025 02:29 PM UTC


Real Python

How to Properly Indent Python Code

Learn how to properly indent Python code in IDEs, Python-aware editors, and plain text editors—plus explore PEP 8 formatters like Black and Ruff.

November 24, 2025 02:00 PM UTC


Python Software Foundation

Python is for Everyone: Grab PyCharm Pro for 30% off—plus a special bonus!

November 24, 2025 10:44 AM UTC


Python Bytes

#459 Inverted dependency trees

Topics include PEP 814 – Add frozendict built-in type, Material for MkDocs Zensical, Tach, and.

November 24, 2025 08:00 AM UTC


Zato Blog

Automation in Python

Automation in Python

How to automate systems in Python and how the Zato Python integration platform differs from a network automation tool, how to start using it, along with a couple of examples of integrations with Office 365 and Jira, is what the latest article is about.

➀ Read it here: Systems Automation in Python.

Systems Automation in Python

Systems Automation in Python

More resources

➀ Python API integration tutorials
➀ What is an integration platform?
➀ Python Integration platform as a Service (iPaaS)
➀ What is an Enterprise Service Bus (ESB)? What is SOA?
➀ Open-source iPaaS in Python

November 24, 2025 03:00 AM UTC

November 22, 2025


Daniel Roy Greenfeld

TIL: Default code block languages for mkdocs

Really useful for making inline code examples have code highlighting.

November 22, 2025 12:08 PM UTC


Brett Cannon

Should I rewrite the Python Launcher for Unix in Python?

I want to be upfront that this blog post is for me to write down some thoughts that I have on the idea of rewriting the Python Launcher for Unix from Rust to pure Python. This blog post is not meant to explicitly be educational or enlightening for others, but

November 22, 2025 12:18 AM UTC


Bruno Ponne / Coding The Past

Data Science Quiz For Humanities

Test your skills with this interactive data science quiz covering statistics, Python, R, and data analysis.

.quiz-container { font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; max-width: 900px; margin: 2rem auto; padding: 1.25rem; } .meta { text-align: center; color: #555; margin-bottom: 1.25rem; } .progress-wrap { background:#eee; border-radius:999px; overflow:hidden; height:14px; margin-bottom:1rem; box-shadow: inset 0 1px 2px rgba(0,0,0,0.03); } .progress-bar { height:100%; width:0%; transition: width 450ms cubic-bezier(.2,.8,.2,1); background: linear-gradient(90deg,#4f46e5,#06b6d4); } .question { background:#fbfdff; border:1px solid #eef2ff; padding:14px; border-radius:12px; margin-bottom:14px; box-shadow: 0 1px 2px rgba(13,17,25,0.03); } .q-head { display:flex; justify-content:space-between; align-items:center; gap:12px; } .q-num { background:#eef2ff; color:#3730a3; padding:6px 10px; border-radius:999px; font-weight:600; font-size:0.9rem; } .options label { display:block; margin:8px 0; padding:8px 10px; border-radius:8px; cursor:pointer; transition: background 180ms, transform 120ms; } .options input { margin-right:8px; } .options label:hover { transform: translateY(-2px); } .correct { background: #ecfdf5; border:1px solid #bbf7d0; } .incorrect { background: #ffefef; border:1px solid #fca5a5; } .muted { color:#666; font-size:0.9rem; } .controls { display:flex; gap:12px; justify-content:flex-end; align-items:center; margin-top:12px; } button.primary { background:#4f46e5; color:white; border:none; padding:10px 16px; border-radius:10px; cursor:pointer; font-weight:600; } button.ghost { background:transparent; border:1px solid #e5e7eb; padding:8px 12px; border-radius:10px; cursor:pointer; } #result { margin-top:16px; font-size:1.05rem; font-weight:700; text-align:center; } .explanation { margin-top:8px; font-size:0.95rem; color:#0f172a; } .fade-in { animation: fadeIn 380ms ease both; } @keyframes fadeIn { from { opacity:0; transform: translateY(6px);} to {opacity:1; transform:none;} } Progress
Answered 0 of 15
1
Which of the following best describes a z-score?
2
What is the main advantage of using tidy data principles in R?
3
In Python, which library is most commonly used for data manipulation?
4
Which metric is best for evaluating a classification model on imbalanced data?
5
In a linear regression, what does RÂČ represent?
6
In historical or humanities datasets, which challenge occurs most frequently?
7
What does the groupby() function do in pandas?
8
What is the primary purpose of cross-validation?
9
Feature engineering refers to:
10
Which visualization is most appropriate for the distribution of a continuous variable?
11
A z-score of +2.5 means:
12
Which is an advantage of using R for statistical analysis?
13
Normalization in data preprocessing means:
14
Why may historical datasets be biased?
15
Which Python function can compute a z-score?

November 22, 2025 12:00 AM UTC


Stéphane Wirtel

Claude Code : comment un assistant IA m'a fait gagner des jours de développement

TL;DR

AprĂšs une semaine d’utilisation intensive de Claude Code1 pendant PyCon Ireland et sur mes projets personnels, je suis complĂštement bluffĂ© par les gains de productivitĂ©. L’outil m’a permis de migrer automatiquement le site Python Ireland de Django 5.0 vers 5.2 et Wagtail 6.2 vers 7.2, de dĂ©velopper un outil de conversion de livres scannĂ©s en 5 minutes, et de gĂ©nĂ©rer une documentation complĂšte en quelques minutes. Contrairement Ă  Cursor ou Windsurf, Claude Code s’intĂšgre partout (PyCharm, VS Code, Zed, Neovim, ligne de commande), ce qui en fait un vĂ©ritable game changer pour les dĂ©veloppeurs professionnels.

November 22, 2025 12:00 AM UTC


Armin Ronacher

LLM APIs are a Synchronization Problem

November 22, 2025 12:00 AM UTC

November 21, 2025


Trey Hunner

Python Morsels Lifetime Access Sale

November 21, 2025 10:42 PM UTC