Advertisement · 728 × 90

Posts by Brett Cannon

Python Tip #102 (of 365):

Use pathlib.Path(directory, filename) to join path strings

To join path strings together, instead of:
joined = Path(directory) / filename

Or:
joined = Path(directory).joinpath(filename)

You can do this:
joined = Path(directory, filename)

#Python #DailyPythonTip

1 day ago 9 1 1 0
Preview
Reflecting on Five Years as the PSF’s First CPython Developer in Residence After nearly five wonderful years at the Python Software Foundation as the inaugural CPython Developer in Residence, it's time for me to move on. I feel honored and honestly so lucky to have had the opportunity to kick off the program that now includes several wonderful full-time engineers. I'm glad to see the program left in good hands. The vacancy created by my departure will be filled after PyCon US as the PSF is currently focused on delivering a strong event. I'm happy to share that Meta will continue to sponsor the CPython Developer in Residence role at least through mid-2027. The program is safe.

Nearly 5 years, countless PRs, a program grown from 1 to 5. Thank you, Łukasz Langa, for defining the CPython Developer in Residence role. Best of luck on the next step of your journey and we'll see you around the community!

8 hours ago 36 10 2 2

We're entering the final stretch of collecting responses for the 2026 Python Developers Survey! 🐍 📊

It only takes 10-15 minutes, and you could win a US$100 Amazon gift voucher.

Complete it here: surveys.jetbrains.com/s3/python-de...

3 days ago 7 7 0 0
The 28th Virginia battle flag is a Confederate battle flag that belonged to the 28th Virginia Infantry Regiment. Captured by the 1st Minnesota Infantry Regiment at the Battle of Gettysburg, the flag was brought to Minnesota and exhibited at the state's capitol for several years before passing into the permanent collection of the Minnesota Historical Society after 1896 where it has remained since.

The 28th Virginia battle flag is a Confederate battle flag that belonged to the 28th Virginia Infantry Regiment. Captured by the 1st Minnesota Infantry Regiment at the Battle of Gettysburg, the flag was brought to Minnesota and exhibited at the state's capitol for several years before passing into the permanent collection of the Minnesota Historical Society after 1896 where it has remained since.

Happy Confederate Surrender Day from Minnesota where we still have your goddamn flag and we’re not giving it up.

en.wikipedia.org/wiki/28th_Vi...

4 days ago 8129 1904 149 167
Preview
does JIT go brrr? | Python JIT Performance Tracker Track Python's experimental JIT compiler performance vs the standard interpreter over time. Daily benchmarks across multiple machines using pyperformance.

Niche but since folks have asked: If you've noticed the prometheus runner (Windows) on doesjitgobrrr.com looking worse lately: tail calls were enabled since that's what shipped in 3.15.0a8, so it's an "interpreter got better" situation, not a JIT regression.

5 days ago 18 2 0 0

🛡️ Trusty Pub now has a home on the web! lmmx.github.io/trusty-pub/

I’ve really not used GitHub Pages in a minute but was ironically a fitting time to throw zizmor and other good practices in the repo as a demo

Also has a (non-exhaustive!) reading list under the Resources tab 👓📖

1 week ago 0 2 1 1

Just sAw it in IMAX while on a staycation and it was pretty great!

1 week ago 3 0 0 0
Preview
Overview - Open Source by Brett Cannon ❔ = might be best as an extension There’s a pattern in how complex technology matures. Early on, teams make their own choices: different tools, different abstractions, different ways of reasoning abo…

opensource.snarky.ca/Python/Workf... has my notes. And we can establish it by shipping a `py` command on all platforms from python.org that provides the workflow and acts as THE way to install Python. The tricky bit is community buy-in as to what that baseline is.

2 weeks ago 1 0 0 0
Preview
Why pylock.toml includes digital attestations A Python project got hacked where malicious releases were directly uploaded to PyPI. I said on Mastodon that had the project used trusted publishing with digital attestations, then people using a pylo...

I said digital attestations and `pylock.toml` would have helped with the litellm attack. People asked for more details, so I wrote a blog post explaining why it would have helped.

snarky.ca/why-pylock-t...

2 weeks ago 21 8 1 0
Interview with Brett Cannon

Guido van Rossum has decided to start a new project: interviewing "key Python developers from the first 25 years".

Here is the one he did with @snarky.ca, posted early this month (h/t @pycoders.com's latest newsletter).

#Python

[1/2]

gvanrossum.github.io/interviews/B...

2 weeks ago 6 7 1 0
Advertisement

It's all about lowering risk. At this point I think a baseline experience around user and developer workflows exists that should be pushed out to everyone so it's easier to have. Having something like that be controlled by a company that's getting put into READMEs is a risk.

2 weeks ago 3 0 2 0

It makes me pretty sad tbh. I see my friends burning out from having to triage all this trash.

I see repos that I used to work on where all human comments on PR reviews are LLM generated. I get folks are using AI but can we not converge toward being 12 LLMs in a trenchcoat maintaining a project?

2 weeks ago 36 3 1 0

The hair cut is the bigger news to me!

2 weeks ago 2 0 0 0

I was already working towards things to de-emphasize uv for the community, so it doesn't change that goal for me. I'm taking a wait-and-see, but I was already trying to help the community hedge any bets that uv might not work out.

3 weeks ago 1 0 2 0

High availability? This isn't a telephone switch.

3 weeks ago 2 0 0 0

No opinion (yet)?

3 weeks ago 2 1 1 0

Rain should be off and on while you're here

3 weeks ago 1 1 0 0
Advertisement
Introduction - PDM

If you’re looking for a nice, modern, featureful #Python package and environment manager, may I suggest PDM?

And maybe also toss some funding their way.

pdm-project.org

3 weeks ago 0 1 1 0

Hence why my proposal uses a new keyword, so it isn't "a function" to begin with.

3 weeks ago 1 0 0 0

I don't know what that kind of dual "is it a statement or an expression?" usage would do to @pablogsal.com .

3 weeks ago 1 0 1 0

Like "I better skip work to get to see it in the theatre" good? Like "stake your reputation in this household about movie reviews" good?

3 weeks ago 3 0 1 0

Yeah, what is there to get mad about?!?

3 weeks ago 2 0 1 0

But maybe that's required to make it work inline as a protocol like PEP 764.

4 weeks ago 1 0 1 0

Eric Snow once said he would rather see it be a callable like `types.SimpleNamespace`. One issue with that is where does the docstring go? As well, a `record` type like I'm suggesting is already pushing syntax a bit, so having function signature syntax work inline would be even more of a stretch.

4 weeks ago 1 0 1 0
Advertisement

There's nothing saying some `record` type can't be treated as a protocol by type checkers but behave like a class. And I don't see why that's hard to teach as typing is usually a much later topic where someone can hopefully understand what a protocol is.

4 weeks ago 2 1 1 0
Preview
My proof-of-concept record type Back in June, I proposed a struct syntax for Python. I shared the post on Mastodon and got some feedback. Afterwards I thought about what I heard and talked it over with some folks. I've now coded up ...

Because dataclasses have to look at type annotations for e.g. `KW_ONLY`, they will cause lazy imports of type hints to reify. One perk to my record idea is that wouldn't be an issue (snarky.ca/my-proof-of-...).

/cc @bitecode.dev

4 weeks ago 13 3 2 0
Preview
B.C. to end time changes, adopt year-round daylight time | CBC News March 8 will be the last time British Columbians have to change their clocks, B.C. Premier David Eby announced Monday.

BC is getting rid of changing the time after spring forward March 6! Pacific Time FTW!

BC got tired of waiting for the west coast of the US to get their act together to change simultaneously.

www.cbc.ca/news/canada/...

1 month ago 7 0 1 0
Preview
State of WASI support for CPython: March 2026 It's been a while since I posted about WASI support in CPython! 😅 Up until now, most of the work I have been doing around WASI has been making its maintenance easier for me and other core developers. ...

Wrote a blog post to give a status update on WASI support for CPython as PEP 816 got accepted!

snarky.ca/state-of-was...

1 month ago 30 9 1 0
Navy background, pink headline "New ways to support Gleam!"; below the headline there's a graphic that shows screen of the "Sponsor" page from gleam.run and its text: "Sponsorship and donations. Support Gleam's development by sponsoring us! he Gleam project" and the description as well as 3 pink buttons: Github Sponsors, Bank Transfer, Liberapay.

Navy background, pink headline "New ways to support Gleam!"; below the headline there's a graphic that shows screen of the "Sponsor" page from gleam.run and its text: "Sponsorship and donations. Support Gleam's development by sponsoring us! he Gleam project" and the description as well as 3 pink buttons: Github Sponsors, Bank Transfer, Liberapay.

Thanks to one of the discussions at the #GleamGathering, we decided to add more options to support Gleam development financially: now you can do it via direct bank transfer ⭐

All the details: gleam.run/sponsor

1 month ago 27 11 0 1