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?
[flagged]
Python 3.15: features that didn't make the headlines
61–70 of 236 posts
Re: Python 3.15: features that didn't make the headlines
#62Earlier quoted context omitted.
> You deleted them (never delete anything, isn't this what modern VCS is all about?) The person said: "deleted 100k+ lines this year already moving them to faster languages" Are you saying that when you move code to another language/rewrite in another language, you leave the original languages code in your repo? They didn't say they deleted it from their git history. I delete code all the time (doesn't mean its "gone…
Well, they deleted it from somewhere. As I assumed they were using a VCS I assumed they deleted it from that. Or are they really short of disk space?
Re: Python 3.15: features that didn't make the headlines
#63From 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?
Note that you can work around it by implementing `def __getattr__(name: str) -> object:` at the module level on earlier Python versions
Re: Python 3.15: features that didn't make the headlines
#64From 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?
Re: Python 3.15: features that didn't make the headlines
#65I 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 ...
Re: Python 3.15: features that didn't make the headlines
#66Re: Python 3.15: features that didn't make the headlines
#67Earlier quoted context omitted.
> 100k lines is tiny No, no, it is not, or at least not in my experience (I do not and never have done web development - medium performance C++ code - I don't see how I could write, understand and support 100K lines of code in this area). And so, what does your Ruby code actually do?
Your experience doesn't match mine. I have, mostly solo, and part time, written multiple codebases that on that kind of magnitude (it is about the level where it still will fit in one person's head pretty easily IMO). It doesn't take much to reach that kind of size. Now, if all of it was super dense and subtle code, then yeah, that would be a lot, but in my experience that's usually a pretty small part of any given c…
Our experiences differ then. Mine is that almost all of the code I write is directly targeted on the usually quite complex problem I am trying to solve. I don't do boilerplate, for example.
Re: Python 3.15: features that didn't make the headlines
#68Earlier quoted context omitted.
[flagged]
> Python is such a weird language. Lazy imports are a bandaid for AI code base monstrosities with 1000 imports Just because you don’t like a feature doesn’t mean it’s because of AI and bad code.
Re: Python 3.15: features that didn't make the headlines
#69Earlier quoted context omitted.
the funny thing is that everyone, including myself, posited that python would be the winner of the ai coding wars, because of how much training data there is for it. My experience has been the opposite.
I felt the opposite, because Python isn’t a great language. It won because of Google, fast prototyping, and its ML interop (e.g. pandas, numpy), but as a language it’s always been subpar. Indentation is a horrible decision (there’s a reason no other language went this way), which led to simple concepts like blocks/lambdas having pretty wild constraints (only one line??) Type decoration has been a welcome addition, bu…
Re: Python 3.15: features that didn't make the headlines
#70Earlier quoted context omitted.
[flagged]
> Python is such a weird language. Lazy imports are a bandaid for AI code base monstrosities with 1000 imports Just because you don’t like a feature doesn’t mean it’s because of AI and bad code.