Re: Style for docstring

2022-04-22 Thread Avi Gross via Python-list
We know some people using "professional" language make things shorteror talk from a point of view different than others and often in otherwise  incomprehensible jargon. If a programmer is taking about the algorithm that a function implements, then, yes, they may write "scan" and "return". But

Re: Style for docstring

2022-04-22 Thread Avi Gross via Python-list
Python does have a concept of "truthy" that includes meaning for not just the standard Booleans but for 0 and non-zero and the empty string and many more odd things such as an object that defines __bool__ (). But saying it returns a Boolean True/False valuesounds direct and simple and

Re: Style for docstring

2022-04-22 Thread MRAB
On 2022-04-23 00:25, Rob Cliffe via Python-list wrote: I don't use docstrings much; instead I put a line or two of comments after the `def ` line. But my practice in such situations is as per the OP's 3rd suggestion, e.g.     # Returns True if . I'm curious as to why so many people prefer

Re: Style for docstring

2022-04-22 Thread Cameron Simpson
On 22Apr2022 17:22, Dan Sommers <2qdxy4rzwzuui...@potatochowder.com> wrote: >"Test whether a permutation is even," while technically factual, leaves >the reader to wonder what form the result takes, and what happens to >that result. Yes, we'd all like to think that programmers are smart >enough

Re: Style for docstring

2022-04-22 Thread Chris Angelico
On Sat, 23 Apr 2022 at 09:31, Rob Cliffe via Python-list wrote: > > I don't use docstrings much; instead I put a line or two of comments > after the `def ` line. > But my practice in such situations is as per the OP's 3rd suggestion, e.g. > # Returns True if . The point of docstrings is

Re: Style for docstring

2022-04-22 Thread Rob Cliffe via Python-list
I don't use docstrings much; instead I put a line or two of comments after the `def ` line. But my practice in such situations is as per the OP's 3rd suggestion, e.g.     # Returns True if . I'm curious as to why so many people prefer "Return" to "Returns". Checking out help() on a few

Re: Style for docstring

2022-04-22 Thread 2QdxY4RzWzUUiLuE
On 2022-04-23 at 08:33:37 +1000, Chris Angelico wrote: > On Sat, 23 Apr 2022 at 08:24, <2qdxy4rzwzuui...@potatochowder.com> wrote: > > > > On 2022-04-22 at 15:35:15 -0500, > > "Michael F. Stemper" wrote: > > > > > On 22/04/2022 14.59, Chris Angelico wrote: > > > > On Sat, 23 Apr 2022 at 05:56,

Re: Style for docstring

2022-04-22 Thread Chris Angelico
On Sat, 23 Apr 2022 at 08:24, <2qdxy4rzwzuui...@potatochowder.com> wrote: > > On 2022-04-22 at 15:35:15 -0500, > "Michael F. Stemper" wrote: > > > On 22/04/2022 14.59, Chris Angelico wrote: > > > On Sat, 23 Apr 2022 at 05:56, Michael F. Stemper > > > wrote: > > > > > > > > I'm writing a function

upgrade pip

2022-04-22 Thread Tola Oj
im trying to upgrade my pip so i can install openpyxl. i though i had successfully upgraded pip, and then I was trying to install openpyxl, but I was getting this: C:\Users\ojomo>"C:\Program Files\Python310\python.exe" -m pip install --upgrade Traceback (most recent call last): File "C:\Program

Re: Style for docstring

2022-04-22 Thread 2QdxY4RzWzUUiLuE
On 2022-04-22 at 15:35:15 -0500, "Michael F. Stemper" wrote: > On 22/04/2022 14.59, Chris Angelico wrote: > > On Sat, 23 Apr 2022 at 05:56, Michael F. Stemper > > wrote: > > > > > > I'm writing a function that is nearly self-documenting by its name, > > > but still want to give it a docstring.

Re: How to have python 2 and 3 both on windows?

2022-04-22 Thread Barry
> On 22 Apr 2022, at 18:43, Gisle Vanem wrote: > > Barry wrote: > >> Tip “py.exe -0” will list the state of installed pythons. > Not here; 'py.exe -0' gives: > Requested Python version (0) not installed > > Which PyInstaller version support this '-0' option? I do not when it was first

Re: Style for docstring

2022-04-22 Thread alister via Python-list
On Fri, 22 Apr 2022 14:36:27 -0500, Michael F. Stemper wrote: > I'm writing a function that is nearly self-documenting by its name, > but still want to give it a docstring. Which of these would be best from > a stylistic point of view: > > >Tells caller whether or not a permutation is even.

Re: Style for docstring

2022-04-22 Thread Michael F. Stemper
On 22/04/2022 14.59, Chris Angelico wrote: On Sat, 23 Apr 2022 at 05:56, Michael F. Stemper wrote: I'm writing a function that is nearly self-documenting by its name, but still want to give it a docstring. Which of these would be best from a stylistic point of view: Tells caller whether

Re: Style for docstring

2022-04-22 Thread Ethan Furman
On 4/22/22 12:36, Michael F. Stemper wrote:   Tells caller whether or not a permutation is even.   Determines if a permutation is even. (Alternative is that it's odd.)   Returns True if permutation is even, False if it is odd. Third option. -- ~Ethan~ --

Re: Style for docstring

2022-04-22 Thread Chris Angelico
On Sat, 23 Apr 2022 at 05:56, Michael F. Stemper wrote: > > I'm writing a function that is nearly self-documenting by its name, > but still want to give it a docstring. Which of these would be > best from a stylistic point of view: > > >Tells caller whether or not a permutation is even. > >

Style for docstring

2022-04-22 Thread Michael F. Stemper
I'm writing a function that is nearly self-documenting by its name, but still want to give it a docstring. Which of these would be best from a stylistic point of view: Tells caller whether or not a permutation is even. Determines if a permutation is even. (Alternative is that it's odd.)

Re: How to have python 2 and 3 both on windows?

2022-04-22 Thread Mats Wichmann
On 4/22/22 11:40, Gisle Vanem wrote: > Barry wrote: > >> Tip “py.exe -0” will list the state of installed pythons. > Not here; 'py.exe -0' gives: >   Requested Python version (0) not installed > > Which PyInstaller version support this '-0' option? > Looks like this got added around 3.7...

Re: How to have python 2 and 3 both on windows?

2022-04-22 Thread Gisle Vanem
Barry wrote: Tip “py.exe -0” will list the state of installed pythons. Not here; 'py.exe -0' gives: Requested Python version (0) not installed Which PyInstaller version support this '-0' option? -- --gv -- https://mail.python.org/mailman/listinfo/python-list

Re: How to have python 2 and 3 both on windows?

2022-04-22 Thread Sunil KR via Python-list
Please excuse the formatting in my previous message. And it is not complete even, so here is the rest of it. What happens after I follow the above steps: - Upon running one of my python 2 scripts (using python2), I see this error:     """       ^SyntaxError: (unicode error) 'unicodeescape' codec

Re: How to have python 2 and 3 both on windows?

2022-04-22 Thread Barry
> On 22 Apr 2022, at 17:10, Sunil KR via Python-list > wrote: > > I have some scripts that are old and won't work under python2 and at the > same time I am writing new scripts which will use python3. However, if python > 2 and 3 cannot co-exist in a windows box it will be impossible to

How to have python 2 and 3 both on windows?

2022-04-22 Thread Sunil KR via Python-list
I have some scripts that are old and won't work under python2 and at the same time I am writing new scripts which will use python3. However, if python 2 and 3 cannot co-exist in a windows box it will be impossible to transition What I try:- remove all pythons and launchers- Use windows installer

Re: struggle to upgrade pip on visual studio code

2022-04-22 Thread Richard Damon
On 4/22/22 6:11 AM, Tola Oj wrote: hello, i successfully installed openpyxl but it is saying this about my pip: WARNING: You are using pip version 22.0.2; however, version 22.0.4 is available.You should consider upgrading via the 'C:\Program Files\Python310\python.exe -m pip install --upgrade

struggle to upgrade pip on visual studio code

2022-04-22 Thread Tola Oj
hello, i successfully installed openpyxl but it is saying this about my pip: WARNING: You are using pip version 22.0.2; however, version 22.0.4 is available.You should consider upgrading via the 'C:\Program Files\Python310\python.exe -m pip install --upgrade pip' command. And then when I try to