Hacker News new | past | comments | ask | show | jobs | submit

Python 3.15: features that didn't make the headlines

https://blog.changs.co.uk/python-315-features-that-didnt-make-the-headlines.html
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?
loading story #48221832
loading story #48221552
loading story #48221225
Python is such a weird language. Lazy imports are a bandaid for AI code base monstrosities with 1000 imports (1% of which are probably Shai Hulud now).

And now even type imports are apparently so slow that you have to disable them if unused during the normal untyped execution.

If Instagram or others wants a professional language, they should switch to Go or PHP instead of shoehorning strange features into a language that wasn't built for their use cases.

loading story #48221459
loading story #48221675
loading story #48221736
loading story #48221519
loading story #48221556
loading story #48223038
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.
loading story #48221735
loading story #48221438
loading story #48221844
Go is terrible for scientific/ML work though, the libraries just aren't there. The wrapping C API story is weak too even with LLMs to assist.

Try and write a signal processing thing with filters, windowing, overlap, etc. - there's no easy way to do it at all with the libraries that exist.

loading story #48221292
loading story #48221152
Same, I’m not sure how Python survives this outside of machine learning.

All of our services we were our are significantly faster and more reliable. We used Rust, it wasn’t hard to do

loading story #48221270
loading story #48221275
loading story #48221477
loading story #48221245
loading story #48222689
loading story #48222195
loading story #48222014