[Python-ideas] Re: Enhancing variable scope control

2022-12-01 Thread David Mertz, Ph.D.
I entirely agree with all of Steven's points. I was going to reply with similar comments, but his are precisely spot-on, and probably more detailed than I would have provided. In particular, the Avdi Grimm essay that Steven linked too is one of the main references I would have provided as well.

[Python-ideas] Re: Enhancing variable scope control

2022-12-01 Thread Steven D'Aprano
On Thu, Dec 01, 2022 at 03:19:38PM -0700, Anony Mous wrote: > I'd love to hear a justification -- any justification -- against what I'm > talking about, because to date, I've never run into one. Many have tried, > too. :) What is the `str` interface? Perhaps not the best example, because

[Python-ideas] Re: Enhancing variable scope control

2022-12-01 Thread Anony Mous
> This is very, very deliberately a design goal of Python. I suspect we're likely not talking about this same "this." Or if we are, I'd love to hear a justification -- any justification -- against what I'm talking about, because to date, I've never run into one. Many have tried, too. :) I'm

[Python-ideas] Re: zip(x, y, z, strict=True)

2022-12-01 Thread Ethan Furman
On 12/1/22 11:36, Ram Rachum wrote: > Reviving this thread 2.5 years after I started it just to share this satisfying moment... Very cool! Always enjoyable to benefit from the fruits of one labors. :-) -- ~Ethan~ ___ Python-ideas mailing list --

[Python-ideas] Re: Enhancing variable scope control

2022-12-01 Thread David Mertz, Ph.D.
This is very, very deliberately a design goal of Python. Ruby is a largely similar language that deliberately made the decision you advocate here. It's a good language, but also one in which monkey patching by imported modules creates a huge amount of chaos. Most large Ruby projects have adopted

[Python-ideas] Re: Enhancing variable scope control

2022-12-01 Thread Anony Mous
>> the string class, which has some annoying tight couplings to "string" and 'string') > What does that mean? > It sounds like you are complaining that the syntax for creating strings creates strings. Or possibly the other way around: that strings are created by string syntax. What did you

[Python-ideas] Re: zip(x, y, z, strict=True)

2022-12-01 Thread Eric Fahlgren
I liked your idea so much back when you suggested it that I implemented it in our sitecustomize.py back when we were using 3.8, and added a check to our lint tools to require that the 'strict=' parameter be present in all uses of 'zip'. We found a couple of silent bugs almost immediately, so

[Python-ideas] Re: zip(x, y, z, strict=True)

2022-12-01 Thread Ram Rachum
Reviving this thread 2.5 years after I started it just to share this satisfying moment. I was just spending a few hours furiously coding on my research using Python 3.10, and when I ran my code I got this traceback: File

[Python-ideas] Re: Enhancing variable scope control

2022-12-01 Thread Greg Ewing
On 1/12/22 9:27 am, Anony Mous wrote: The idea is that YOU write "local:", and the interpreter, without you ever seeing it, promotes that into a hidden function with a hidden name and a hidden call. But if that's *all* it does, then this wouldn't happen: I would expect them to return to, or