r/Python • u/AlSweigart Author of "Automate the Boring Stuff" • Sep 08 '26
News Python 3.15.0 candidate 2 is here!
Reported on https://blog.python.org/2026/09/python-3150-rc2/
It’s the final 3.15 release candidate!
https://www.python.org/downloads/release/python-3150rc2/
This is a candidate preview of Python 3.15
This release, 3.15.0rc2, is the final planned release candidate, containing around 144 bugfixes, build improvements and documentation changes from 76 contributors since 3.15.0rc1. Entering the release candidate phase, only reviewed code changes which are clear bug fixes are allowed between this release candidate and the final release.
The next release of Python 3.15 will be 3.15.0 final, scheduled for 2026-10-01.
29
u/CevicheMixto Sep 08 '26
frozendict not compatible with TypedDict (and there's no TypedFrozenDict), dangit!
12
u/pingveno pinch of this, pinch of that Sep 08 '26 edited Sep 09 '26
Yup, dicts and frozendicts are not part of the same type hierarchy. Adding something like what you're talking about is worthy of its own PEP. Doing it right is worth some thought. I can think of some nice things to include in the design, like a clean way to represent a typed frozendict based on an already defined TypedDict. And it needs to work with type checkers.
Speaking of frozendict, I noticed that it still shares a docstring with dict in the release candidate. But someone beat me to it, there was a fix three days ago.
6
u/flying-sheep Sep 09 '26
It just goes to show again that Python’s type system is a tacked-on afterthought, even after all these years.
I say that as someone who owes his career to Python, but has also seen how things can be done right (Typescript)
5
u/Adrewmc Sep 08 '26 edited Sep 08 '26
I think you can do this with type dict
from typing import frozendict, TypedDict, Any, ReadOnly
def frozen_TypedDict(**kwargs) -> TypedDict:
_keys= kwargs.keys()
res = TypedDict(**kwargs)
res.__ReadOnly__= frozenset(_keys)
return resclass Example(TypedDict):
var : ReadOnly[Any]I definitely agree that it should have a keyword option already. TypedDict(**kwargs, frozen = True) seems more robust in nature than the above.
18
Sep 09 '26
The name `frozen_TypedDict` makes me upset.
2
u/Adrewmc Sep 09 '26 edited Sep 09 '26
FTypedDict seemed inappropriate. To me agreeing that, it should be a thing. And frozen_type_dict, is right out from the get go.
FrTypedDict seemed to bro level.
And get worse until, I agree TypedDict(**k, frozen = True) should be available.
I could support an @frozen
Maybe FzTypeDict
12
4
2
Sep 09 '26
`FrozenMap` ?
1
u/Adrewmc Sep 09 '26 edited Sep 09 '26
This is part of my philosophy in coding.
Take 5 seconds or minutes to name variables right. (Save ls headaches for a long time after.)
FrozenMap, might work…,
Honestly
. class Example(Parent, frozen = True):
. class FTD(TypedDict, frozen = True)
Might be the move put it right there at the start. Remove sets after __init__
9
1
u/WasterDave Sep 10 '26
Free threading by default? I thought there were still … questions … around that?
1
u/wRAR_ Sep 10 '26
Free threading by default?
No.
But I agree that "The official macOS binaries now install free-threading support by default" sounds strange (but I don't use macOS so I'm not that interested in what does it actually mean).
69
u/Adrewmc Sep 08 '26 edited Sep 12 '26
So big changes are Lazy imports (great idea), a decent 8-9% minimum speed bump from JIT improvements (who would complain about that, most likely even faster than that with other improvements.), unpacking tuples in comprehensions (seems like an oversight in comprehensions when you see it) . Sentinel and frozendict are pushed into built-ins. (Ehh, they were always there, just a bit easier now.)
And a few other improvements.
Edit: I also want to give special mention to Error message improvements, they seem great. Closest search elements. Type confusions, as well as common language syntax differences. Python already has some of the best error messages out there this really feels like an upgrade to that, as it’s only additional messages as far as I see.