logoalt Hacker News

Python 3.15: features that didn't make the headlines

195 pointsby rbanffytoday at 11:10 AM84 commentsview on HN

Comments

kokadatoday 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?
show 5 replies
JohnKemenytoday 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

show 1 reply
syedMohib45today at 4:12 PM

Thread safe ittertors? really are we still on these topics

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)

brianwawoktoday 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.

show 9 replies
kwon-youngtoday 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/

veqqtoday at 3:39 PM

There's a good interview about Python internals and management, particularly in relation to free-threading: https://alexalejandre.com/programming/interview-with-ngoldba...

armanjtoday 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-otoday 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 ...

show 1 reply