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
22, 2022 4:58 PM
To: python-list@python.org
Subject: A trivial question that I don't know - document a function/method
Hi all!
What is the correct way, if any, of documenting a function/method?
1.
def foo(a,b):
""" A description.
a: Whatever 1
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
À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
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,
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):
> "
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
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
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
"""
...
2.
def foo(a,b):
""" A description.
a -- Whatever 1
b -- Whatever 2
"""