Re: A trivial question that I don't know - document a function/method

2022-10-24 Thread Mats Wichmann
On 10/23/22 14:20, Paulo da Silva wrote: Às 21:58 de 22/10/22, Paulo da Silva escreveu: Hi all! What is the correct way, if any, of documenting a function/method? Thank you all for the, valuable as usual, suggestions. I am now able to make my choices. Paulo It also matters whether you exp

RE: A trivial question that I don't know - document a function/method

2022-10-24 Thread Schachner, Joseph (US)
I head a small software team much of whose output is Python. I would gratefully accept any of the formats you show below. My preference is #1. --- Joseph S. Teledyne Confidential; Commercially Sensitive Business Data -Original Message- From: Paulo da Silva Sent: Saturday, October

Re: A trivial question that I don't know - document a function/method

2022-10-23 Thread Karsten Hilbert
Am Sun, Oct 23, 2022 at 05:16:48PM -0400 schrieb Thomas Passin: > > def make_title_from_headline(self, p, h) -> str: > > > > def plot(self, stackposition=MAIN, clearFirst=True) -> None: > 1. Knowing the type of a parameter isn't all you usually want to know; Sure, as I said: > >and use

Re: A trivial question that I don't know - document a function/method

2022-10-23 Thread Paulo da Silva
Às 21:58 de 22/10/22, Paulo da Silva escreveu: Hi all! What is the correct way, if any, of documenting a function/method? Thank you all for the, valuable as usual, suggestions. I am now able to make my choices. Paulo -- https://mail.python.org/mailman/listinfo/python-list

Re: A trivial question that I don't know - document a function/method

2022-10-23 Thread Thomas Passin
On 10/23/2022 2:37 PM, Karsten Hilbert wrote: Am Sat, Oct 22, 2022 at 09:49:55PM -0400 schrieb Thomas Passin: def make_title_from_headline(self, p, h): """From node title, return title with over- and underline- strings. ... RETURNS a string """ def plot(self,

Re: A trivial question that I don't know - document a function/method

2022-10-23 Thread Karsten Hilbert
Am Sat, Oct 22, 2022 at 09:49:55PM -0400 schrieb Thomas Passin: > def make_title_from_headline(self, p, h): > """From node title, return title with over- and underline- strings. ... >RETURNS >a string > """ > def plot(self, stackposition=MAIN, clearFirst=True): > "

Re: A trivial question that I don't know - document a function/method

2022-10-22 Thread Thomas Passin
On 10/22/2022 4:58 PM, Paulo da Silva wrote: Hi all! What is the correct way, if any, of documenting a function/method? 1. def foo(a,b): """ A description. a: Whatever 1 b: Whatever 2 """ [snip] 5. Any other ... Any comments/suggestions are welcome. Thanks. Paulo

Re: A trivial question that I don't know - document a function/method

2022-10-22 Thread Dan Stromberg
I don't think there is a "correct" way. It depends somewhat on what tools you're using. I like pydocstyle, which I have hung off of vim with syntastic. pydocstyle checks for https://peps.python.org/pep-0257/ conformance. Also, rather than describe the types of formal parameters to functions in