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):
> "
ons are welcome.
Thanks.
Paulo
This is not a trivial question - not because it is hard but because it
is important, and more so when someone else needs to work with your
code. It's surprising how easy it is to forget these details about even
your own code. Here are some examples of ho
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
"""
On Sep 29, 8:06 am, Chris Rebert wrote:
> Try this:
>
> def trial():
> class Foo(object):
> def __init__(self):
> print("Hello, world!")
> Foo()
> trial()
While this will display "Hello, world!" in the way required, with a
slight adjustment you end up with something po
HI
The class Foo you have defined is local NameSpace for trial functioon, for
details http://docs.python.org/tutorial/classes.html
def trial():
class Foo(object):
def __init__(self):
print("Hello, world!")
lacalClass = Foo()
>>>trial
"Hello, world!"
Thanks
Jitendra
On Thu, Sep 29, 2011 at
I accidentally wrote such a code (below) while trying to write sth else for my
application but i am now just wondering much how to run the class Foo, if it is
possible. Is not it weird that Python does not give any error when I run it ?
Sorry for that it's pretty unimportant question according t
On Thu, Sep 29, 2011 at 7:53 AM, Tayfun Kayhan
wrote:
> def trial():
>class Foo(object):
> def __init__(self):
> print("Hello, world!")
> trial() # not worked, as expected.
Python doesn't have "class declarations" in the way that some other
languages do. The 'class' statement i
On Wed, Sep 28, 2011 at 2:53 PM, Tayfun Kayhan
wrote:
> I accidentally wrote such a code (below) while trying to write sth else for
> my application but i am now just wondering much how to run the class Foo, if
> it is possible. Is not it weird that Python does not give any error when I
> run it ?
I accidentally wrote such a code (below) while trying to write sth else for my
application but i am now just wondering much how to run the class Foo, if it is
possible. Is not it weird that Python does not give any error when I run it ?
Sorry for that it's pretty unimportant question according t
15 matches
Mail list logo