Re: Use of a variable in parent loop

2020-09-27 Thread Stephane Tougard via Python-list
On 2020-09-28, Mike Dewhirst wrote: > [1] If you live with Perl non-stop I agree Perl code can be read in > future. But it requires allocation of serious brain-space for me at > least to come back to it. Let's be franc, I can read my own Perl code (very C-ish) without any issue. I live with it si

Re: Use of a variable in parent loop

2020-09-27 Thread Stephane Tougard via Python-list
On 2020-09-28, Cameron Simpson wrote: > That said, Stephane: I don't believe in "best practice" as _the_ best > practice, but I certainly believe there's "bad practice". I kind of disagree with that, what I mean that there is no bad practice to get the work done. There may be bad practice to wri

Re: Use of a variable in parent loop

2020-09-27 Thread Stephane Tougard via Python-list
On 2020-09-28, Manfred Lotz wrote: > On Mon, 28 Sep 2020 05:20:20 +0800 > Stephane Tougard wrote: > >> On 2020-09-27, Manfred Lotz wrote: >> > - http://localhost:2015/tutorial/controlflow.html#pass-statements >> ... >> > (In comparison to guys like ChrisA and StefanR and others here I am >> >

Re: Use of a variable in parent loop

2020-09-27 Thread Stephane Tougard via Python-list
On 2020-09-28, MRAB wrote: > It's used where the language requires a statement. > > In, say, C, you would use empty braces: > > while (process_next_item()) { > /* Do nothing. */ > } If I want to express nothing in C, I put nothing and it works fine. #include int main(int arg

Re: Use of a variable in parent loop

2020-09-27 Thread Mike Dewhirst
On 28/09/2020 12:56 pm, Stephane Tougard via Python-list wrote: > On 2020-09-27, Cameron Simpson wrote: >>> In many non declarative language, if I do print($var), it just prints >>> and undefined value with returning an error. >> And that way lie MANY MANY bugs not detected until an undefined valu

Re: Use of a variable in parent loop

2020-09-27 Thread Cameron Simpson
On 28Sep2020 13:43, Chris Angelico wrote: >On Mon, Sep 28, 2020 at 12:31 PM Stephane Tougard via Python-list > wrote: >> To be frank, I don't really care the rules and supposed best practices, >> I use a language the way it fits me. So I'll pass on the advices like >> "we never use this like this"

Re: Use of a variable in parent loop

2020-09-27 Thread Chris Angelico
On Mon, Sep 28, 2020 at 12:31 PM Stephane Tougard via Python-list wrote: > To be frank, I don't really care the rules and supposed best practices, > I use a language the way it fits me. So I'll pass on the advices like > "we never use this like this" without more reason that "we just don't do > it

Re: Use of a variable in parent loop

2020-09-27 Thread MRAB
On 2020-09-28 03:53, Stephane Tougard via Python-list wrote: On 2020-09-27, Chris Angelico wrote: Or maybe Emacs *isn't* breaking it, and it's just an autoindentation thing. I don't know. From the discussion I read about this feature, it considers that 'pass' is use to write an empty def()

Re: Use of a variable in parent loop

2020-09-27 Thread Manfred Lotz
On Mon, 28 Sep 2020 05:20:20 +0800 Stephane Tougard wrote: > On 2020-09-27, Manfred Lotz wrote: > > - http://localhost:2015/tutorial/controlflow.html#pass-statements > ... > > (In comparison to guys like ChrisA and StefanR and others here I am > > also a Python beginner) > > To give me a po

Re: Use of a variable in parent loop

2020-09-27 Thread Stephane Tougard via Python-list
On 2020-09-27, Chris Angelico wrote: > Or maybe Emacs *isn't* breaking it, and it's just an autoindentation > thing. I don't know. >From the discussion I read about this feature, it considers that 'pass' is use to write an empty def() def(); pass So it's logic for it to indent one level

Re: Use of a variable in parent loop

2020-09-27 Thread Stephane Tougard via Python-list
On 2020-09-27, Cameron Simpson wrote: >>In many non declarative language, if I do print($var), it just prints >>and undefined value with returning an error. > > And that way lie MANY MANY bugs not detected until an undefined value > actually causes an issue, if that ever happens. In some language

Re: Use of a variable in parent loop

2020-09-27 Thread Stephane Tougard via Python-list
On 2020-09-27, Terry Reedy wrote: > emacs with python-mode has been and likely still is used by some > experienced python programmers. I have never seen anyone but a rank Yes, since I discovered that an empty has almost the same effect than a pass to end a block. > The 'pass' line does not mar

Re: Use of a variable in parent loop

2020-09-27 Thread Stephane Tougard via Python-list
On 2020-09-27, Avi Gross wrote: > But when someone insists Python needs to > change to meet their preconception, I get less sympathetic. To clarify my question, I never asked that Python changes for me, I asked if there was any way to change Python's behavior by using a module or a configuration

Re: Can't install Python

2020-09-27 Thread Mats Wichmann
On 9/27/20 4:48 PM, MRAB wrote: >> Whatever I try, whenever I click on the phyton.exe file, Python seems >> to install, but only ultimately displays a Modify Setup screen. >> I have tried the modifying and repairing options, but they all just >> lead to the same Modify Setup screen. > So you ran

Re: Use of a variable in parent loop

2020-09-27 Thread Greg Ewing
On 27/09/20 10:27 pm, Stephane Tougard wrote: That's not a question of editor, that's a question of having a clear way to mark the end of a block, I guess the Emacs maintener found this way and I think it's a great idea. I doubt whether the authors of the Emacs python-mode had this way of using

Re: Use of a variable in parent loop

2020-09-27 Thread Chris Angelico
On Sun, Sep 27, 2020 at 9:41 PM Manfred Lotz wrote: > > On Sun, 27 Sep 2020 15:18:44 +0800 > Stephane Tougard wrote: > > > On 2020-09-27, 2qdxy4rzwzuui...@potatochowder.com > > <2qdxy4rzwzuui...@potatochowder.com> wrote: > > > As ChrisA noted, Python almost always Just Works without > > > declara

Re: Use of a variable in parent loop

2020-09-27 Thread Chris Angelico
On Mon, Sep 28, 2020 at 7:50 AM Stephane Tougard via Python-list wrote: > > On 2020-09-27, Stefan Ram wrote: > >>Is there any other instruction to end a if than pass and ensure Emacs > >>does not break the indentation during a copy paste or an indent-region ? > > > > We usually do not wish to t

Re: Can't install Python

2020-09-27 Thread MRAB
On 2020-09-27 22:43, Hugh Pittman wrote: Hi; I've spent several hours over two days unsuccessfully trying to install Python. I am trying to install it on a desktop computer running on a Windows10 64-bit / AMD CPU platform. I have tried installing various versions. I have also tried downloading

Re: Use of a variable in parent loop

2020-09-27 Thread MRAB
On 2020-09-27 10:27, Stephane Tougard via Python-list wrote: On 2020-09-27, Stefan Ram wrote: Is there any other instruction to end a if than pass and ensure Emacs does not break the indentation during a copy paste or an indent-region ? We usually do not wish to tie our code to a defective

Can't install Python

2020-09-27 Thread Hugh Pittman
Hi; I've spent several hours over two days unsuccessfully trying to install Python. I am trying to install it on a desktop computer running on a Windows10 64-bit / AMD CPU platform. I have tried installing various versions. I have also tried downloading Python from other websites, aside from pyth

Re: Use of a variable in parent loop

2020-09-27 Thread Stephane Tougard via Python-list
On 2020-09-27, Stefan Ram wrote: >>Is there any other instruction to end a if than pass and ensure Emacs >>does not break the indentation during a copy paste or an indent-region ? > > We usually do not wish to tie our code to a defective editor. > I use vi, and can assure you that there is no

Re: Use of a variable in parent loop

2020-09-27 Thread Terry Reedy
On 9/26/2020 3:36 PM, Stephane Tougard via Python-list wrote: On 2020-09-26, Terry Reedy wrote: Noise. Only 'pass' when there is no other code. Why ? I use pass and continue each time to break a if or a for because emacs understands it and do not break the indentation. Is there any othe

Re: Use of a variable in parent loop

2020-09-27 Thread Stephane Tougard via Python-list
On 2020-09-27, Chris Angelico wrote: > If you MUST use a block-end marker, try "# end" instead - at least > then everyone *knows* it's nothing more than a comment. Damn, you could not say that earlier !!! -- https://mail.python.org/mailman/listinfo/python-list

pip update fails

2020-09-27 Thread Hylton
Hello, � When I tried to install a package using pip, it informed me that there is a new version available. � Per the recommendation, I tried to update pip, but the update failed. � The following is the last few lines of the failure messages: V

Re: Use of a variable in parent loop

2020-09-27 Thread Grant Edwards
On 2020-09-27, Stephane Tougard via Python-list wrote: > an indentation is not good enough for me to end a block Maybe you need to choose a different language -- one that has block delimiter keywords or tokens. > and it may > trigger some problem when using different editors or tools on the > c

Re: Use of a variable in parent loop

2020-09-27 Thread Cameron Simpson
On 27Sep2020 15:18, Stephane Tougard wrote: >In many non declarative language, if I do print($var), it just prints >and undefined value with returning an error. And that way lie MANY MANY bugs not detected until an undefined value actually causes an issue, if that ever happens. In some languages

Re: Use of a variable in parent loop

2020-09-27 Thread Richard Damon
On 9/27/20 4:42 PM, Christian Gollwitzer wrote: > Am 26.09.20 um 06:43 schrieb Stephane Tougard: >> ===PYTHON=== >> #!/usr/local/bin/python >> if 4 == 4: >> name = "Stephane" >> print(name) >> pass >> >> print("Out {}".format(name)) >> >> >> The exact same code in Python

Re: Use of a variable in parent loop

2020-09-27 Thread Christian Gollwitzer
Am 26.09.20 um 06:43 schrieb Stephane Tougard: ===PYTHON=== #!/usr/local/bin/python if 4 == 4: name = "Stephane" print(name) pass print("Out {}".format(name)) The exact same code in Python works fine, the variable name is used outside of the if block even it has been

RE: Use of a variable in parent loop

2020-09-27 Thread Avi Gross via Python-list
These discussions can be bit frustrating. People talk past each other. Languages seem almost like religions, as do paradigms. I try to stay above it and absorb each paradigm as an alternative choice made and then try to think of what problems I can solve better with one or another and so on. P

Re: FW: pipenv has issues

2020-09-27 Thread Mats Wichmann
On 9/25/20 10:00 PM, Rhett Prince wrote: > see below: > > > > pipenv gets lost and crashes. > > > > > > hi, where do we write to to post defects in pipenv? on a windows 8.1 > machine after installing pipenv with poip as administrator pipenv simply > crashes with a trace dump it get

Re: Use of a variable in parent loop

2020-09-27 Thread Joe Pfeiffer
Stephane Tougard writes: > On 2020-09-27, Stefan Ram wrote: >>>Is there any other instruction to end a if than pass and ensure Emacs >>>does not break the indentation during a copy paste or an indent-region ? >> >> We usually do not wish to tie our code to a defective editor. >> I use vi, an

Re: Use of a variable in parent loop

2020-09-27 Thread 2QdxY4RzWzUUiLuE
On 2020-09-27 at 15:18:44 +0800, Stephane Tougard via Python-list wrote: > In many non declarative language, if I do print($var), it just prints > and undefined value with returning an error. If I want "many non declarative language[s]," I know where to find them, and I won't expect them to hono

Re: Use of a variable in parent loop

2020-09-27 Thread Manfred Lotz
On Sun, 27 Sep 2020 15:18:44 +0800 Stephane Tougard wrote: > On 2020-09-27, 2qdxy4rzwzuui...@potatochowder.com > <2qdxy4rzwzuui...@potatochowder.com> wrote: > > As ChrisA noted, Python almost always Just Works without > > declarations. If you find yourself with a lot of global and/or > > nonlocal

Re: Use of a variable in parent loop

2020-09-27 Thread Chris Angelico
On Sun, Sep 27, 2020 at 9:01 PM Stephane Tougard via Python-list wrote: > > On 2020-09-27, 2qdxy4rzwzuui...@potatochowder.com > <2qdxy4rzwzuui...@potatochowder.com> wrote: > > As ChrisA noted, Python almost always Just Works without declarations. > > If you find yourself with a lot of global and/

Re: Use of a variable in parent loop

2020-09-27 Thread Chris Angelico
On Sun, Sep 27, 2020 at 9:01 PM Stephane Tougard via Python-list wrote: > > On 2020-09-27, Stefan Ram wrote: > >>Is there any other instruction to end a if than pass and ensure Emacs > >>does not break the indentation during a copy paste or an indent-region ? > > > > We usually do not wish to t

Re: Use of a variable in parent loop

2020-09-27 Thread Stephane Tougard via Python-list
On 2020-09-27, Stefan Ram wrote: >>Is there any other instruction to end a if than pass and ensure Emacs >>does not break the indentation during a copy paste or an indent-region ? > > We usually do not wish to tie our code to a defective editor. > I use vi, and can assure you that there is no

Re: Use of a variable in parent loop

2020-09-27 Thread Stephane Tougard via Python-list
On 2020-09-27, 2qdxy4rzwzuui...@potatochowder.com <2qdxy4rzwzuui...@potatochowder.com> wrote: > As ChrisA noted, Python almost always Just Works without declarations. > If you find yourself with a lot of global and/or nonlocal statements, > perhaps you're [still] thinking in another language. I