Earlier quoted context omitted.
I’ve often thought it would be funny if instead of an error message for stuff like this, a language could be designed to be “typo-insensitive”. If a method or function call is similar enough to an existing one or a common one from other languages, to just have it silently use that.
VisualBasic did that. I think it is a mistake. But that doesn't mean that the compiler can't detect that and tell you how to fix it instead.
Python 3.15: features that didn't make the headlines
121–130 of 236 posts
Re: Python 3.15: features that didn't make the headlines
#122> Iterators, async functions and async iterators don't work well here because they have different semantics to standard functions. When you call them they return immediately with a generator object, coroutine function and async generator object respectively. So the decorator completes immediately as opposed to the entire lifecycle what it's wrapping. > This is an unfortunate problem I've encountered many times, and i…
Re: Python 3.15: features that didn't make the headlines
#123> Iterators, async functions and async iterators don't work well here because they have different semantics to standard functions. When you call them they return immediately with a generator object, coroutine function and async generator object respectively. So the decorator completes immediately as opposed to the entire lifecycle what it's wrapping. > This is an unfortunate problem I've encountered many times, and i…
Re: Python 3.15: features that didn't make the headlines
#124> Iterators, async functions and async iterators don't work well here because they have different semantics to standard functions. When you call them they return immediately with a generator object, coroutine function and async generator object respectively. So the decorator completes immediately as opposed to the entire lifecycle what it's wrapping. > This is an unfortunate problem I've encountered many times, and i…
Eh, what's the worst that could happen? Developers opting to run an old version of Python due to incompatible changes? I can't see that happening.
Re: Python 3.15: features that didn't make the headlines
#125> Iterators, async functions and async iterators don't work well here because they have different semantics to standard functions. When you call them they return immediately with a generator object, coroutine function and async generator object respectively. So the decorator completes immediately as opposed to the entire lifecycle what it's wrapping. > This is an unfortunate problem I've encountered many times, and i…
The Python core team seems to think it's unlikely that anyone's relying on the existing behavior: https://github.com/python/cpython/pull/136212#issuecomment-4...
Re: Python 3.15: features that didn't make the headlines
#126Earlier quoted context omitted.
> 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.
I think this is just a natural consequence of an easy-to-use package system. The exact same story as with node. If you don't want lots of imports, don't make it so damn easy to pile them into projects. I'm frankly surprised we still see so few supply chain attacks, even though they picked up their cadence dramatically.
Re: Python 3.15: features that didn't make the headlines
#127Earlier quoted context omitted.
> it seems pretty common for dynamically typed languages and pretty much entirely absent from statically typed ones Counter-example is Go and init() function.
Also C++/Java static initialization, C# static constructors, or Rust global variable initialization, ... Most languages have this feature Afaik
Re: Python 3.15: features that didn't make the headlines
#128Lazy loading looks like a last nail in the coffin, where my love to Python was buried, although it was a long, tiresome process.
Re: Python 3.15: features that didn't make the headlines
#129Earlier quoted context omitted.
Interested in why you'd use Python in the first place? Advice for someone who knows nothing about programming - what would you suggest?
IMO the main reasons people use Python are: 1. The very first steps are quite simple. Hello world is literally just `print("hello world")`. In other languages it can be a lot more complex. 2. It got a reputation as a beginner-friendly language as a result. 3. It has a "REPL" which means you can type code into a prompt and it will execute it interactively. This is very helpful for research (think AI) where you're tryi…
lol, no. Just no. Python is far superior for website backends unless perhaps you're running one of the top 20 websites in the world.
Re: Python 3.15: features that didn't make the headlines
#130Earlier quoted context omitted.
This seems a lot more due to an import running arbitrary code because stuff can happen in the top-level of a module rather than only happening in functions. From what I can tell, it seems pretty common for dynamically typed languages and pretty much entirely absent from statically typed ones, which tend to have a main function that everything else happens inside transitively. I guess this makes it easy if what you're…
> it seems pretty common for dynamically typed languages and pretty much entirely absent from statically typed ones Counter-example is Go and init() function.