Python 3.15: features that didn't make the headlines

142 points - today at 11:10 AM

Source

Comments

kwon-young today at 2:18 PM
It's nice that python 3.15 added Iterator synchronization primitives: https://docs.python.org/3.15/library/threading.html#iterator.... These will nicely complement my threaded-generator package which is doing just this but using a thread/process+generator+queue: https://pypi.org/project/threaded-generator/
kokada today at 11:54 AM
From this example:

    lazy from typing import Iterator

    def stream_events(...) -> Iterator[str]:
        while True:
            yield blocking_get_event(...)

    events = stream_events(...)

    for event in events:
        consume(event)
Do we finally have "lazy imports" in Python? I think I missed this change. Is this also something from Python 3.15 or earlier?
JohnKemeny today at 12:28 PM
> I've left this one to the bonus section because I've never used set operations on Counters and I'm finding it extremely hard to think of a use case for xor specifically. But I do appreciate the devs adding it for completeness.

Check out symmetric difference

https://en.wikipedia.org/wiki/Symmetric_difference

brianwawok today at 11:44 AM
I was so into Python for 10 years, was enjoyable to work in. But have deleted 100k+ lines this year already moving them to faster languages in a post AI codebot world. Mostly moving to go these days.
armanj today at 1:59 PM
funny how we may have to wait even longer for llms to pick up this update in their pre-training
sunshine-o today at 1:21 PM
I am not a python dev but have the utmost respect for the ecosystem.

But damn, with all the supply chain attacks now in the news, could they just make a simple way (for non python insiders) to install python apps without fearing to be infected by a vermin with full access to my $HOME ...

deleted today at 1:07 PM