Re: Style for docstring

2022-04-25 Thread dn
On 26/04/2022 11.47, Rob Cliffe via Python-list wrote: > Well, de gustibus non est disputandum.  For me, the switch from the > imperative mode to the descriptive mode produces a mild cognitive > dissonance. Disagree! When coding, to whom?what are you talking? When writing documentation - same qu

Re: Style for docstring

2022-04-25 Thread Rob Cliffe via Python-list
Well, de gustibus non est disputandum.  For me, the switch from the imperative mode to the descriptive mode produces a mild cognitive dissonance. Best wishes Rob Cliffe On 25/04/2022 23:34, Cameron Simpson wrote: On 23Apr2022 03:26, Avi Gross wrote: We know some people using "professional" l

Re: Style for docstring

2022-04-25 Thread Mats Wichmann
On 4/25/22 16:34, Cameron Simpson wrote: > On 23Apr2022 03:26, Avi Gross wrote: >> 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

Re: Style for docstring

2022-04-25 Thread Cameron Simpson
On 23Apr2022 03:26, Avi Gross wrote: >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,

Re: Style for docstring

2022-04-24 Thread Avi Gross via Python-list
t;, "Return(s)": "Text", "Optional-Note": "Text", "French version": DocStringFrench} Too late to seriously change the language now! -Original Message- From: Michael F. Stemper To: python-list@python.org Sent: Sun, Apr 24, 2022 9:24 am Subj

Re: Style for docstring

2022-04-24 Thread dn
On 25/04/2022 01.24, Michael F. Stemper wrote: > On 23/04/2022 12.43, Avi Gross wrote: >> Given what you added, Michael, your function is part of a >> larger collection of functions and being compatible with the others >> is a valid consideration. Whatever you decide, would ideally be done >> consi

Re: Style for docstring

2022-04-24 Thread Michael F. Stemper
On 24/04/2022 08.24, Michael F. Stemper wrote: On 23/04/2022 12.43, Avi Gross wrote: Given what you added, Michael, your function is part of a larger collection of functions and being compatible with the others is a valid consideration. Whatever you decide, would ideally be done consistently w

Re: Style for docstring

2022-04-24 Thread Michael F. Stemper
On 23/04/2022 12.43, Avi Gross wrote: Given what you added, Michael, your function is part of a larger collection of functions and being compatible with the others is a valid consideration. Whatever you decide, would ideally be done consistently with all or most of them. And, of course, it oth

Re: Style for docstring

2022-04-23 Thread dn
On 23/04/2022 08.35, 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. Which of these would be >

Re: Style for docstring

2022-04-23 Thread jan via Python-list
"return true iff this". I like this. jan On 23/04/2022, Stefan Ram wrote: > Rob Cliffe writes: >>I'm curious as to why so many people prefer "Return" to "Returns". > > The commands, er, names of functions, use the imperative mood > ("print", not "prints"). So, "return" aligns with that moo

Re: Style for docstring

2022-04-23 Thread Dan Stromberg
On Fri, Apr 22, 2022 at 12:56 PM Michael F. Stemper < michael.stem...@gmail.com> 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

Re: Style for docstring

2022-04-23 Thread Avi Gross via Python-list
. -Original Message- From: Michael F. Stemper To: python-list@python.org Sent: Sat, Apr 23, 2022 8:57 am Subject: Re: Style for docstring On 22/04/2022 21.58, Avi Gross wrote: > Python does have a concept of "truthy" that includes meaning for not just the > standard

Re: Style for docstring

2022-04-23 Thread Michael F. Stemper
On 22/04/2022 16.12, alister wrote: 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: for guidance I would suge

Re: Style for docstring

2022-04-23 Thread Michael F. Stemper
On 22/04/2022 21.58, Avi Gross wrote: 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 value

Re: Style for docstring

2022-04-22 Thread Avi Gross via Python-list
-Original Message- From: MRAB To: python-list@python.org Sent: Fri, Apr 22, 2022 8:57 pm Subject: Re: Style for docstring 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

Re: Style for docstring

2022-04-22 Thread Avi Gross via Python-list
user can ignore or not even catch. -Original Message- From: Chris Angelico To: python-list@python.org Sent: Fri, Apr 22, 2022 6:33 pm Subject: Re: Style for docstring On Sat, 23 Apr 2022 at 08:24, <2qdxy4rzwzuui...@potatochowder.com> wrote: > > On 2022-04-22 at 15:35:15 -050

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 to

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 funct

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, M

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

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: 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~ -- https://mail.python.org/mailman/l

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. > >