Style for docstring
jan
rtm443x at googlemail.com
Sat Apr 23 15:09:11 EDT 2022
"return true iff this".
I like this.
jan
On 23/04/2022, Stefan Ram <ram at zedat.fu-berlin.de> wrote:
> Rob Cliffe <rob.cliffe at btinternet.com> 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 mood
> as a paraphrase of such names.
>
> In Java, at one point, they decided to start to use the
> third person at one point and then half-heartedly converted
> all the documentation, as in
>
> |void println(boolean x)
> |Prints a boolean and then terminate the line.
>
> , where they modified "print" but did not bother do modify
> "terminate".
>
> And instead of "return true if this, false if not this",
> I might be inclined to write "return true iff this".
>
> BTW: As a language element that helps to construct a boolean
> expression from a file name, some languages, like SQL, use
> "EXISTS", while others, like MS-DOS-batch, use "EXIST".
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
More information about the Python-list
mailing list