Steven D'Aprano wrote:
On Mon, 27 Jul 2009 00:47:08 +0200, Diez B. Roggisch wrote:
Only modules, classes, and functions/methods can have docstrings
associated with them.
For anything else, you have to use comments; or you can mention them in
the docstrings of related things.
While
Hello, I'm new to Python (using it for two months) and I wonder how can I
comment the const. values with the doc-strings. I.e. if I have code:
FRACTION_MIN = 1
FRACTION_MAX = 10
class Fraction(collections.MutableSequence):
'''Model a fraction with denominators.
It contains one ore more
On Sun, Jul 26, 2009 at 2:49 PM, Erwin Muellerdev...@deventm.org wrote:
Hello, I'm new to Python (using it for two months) and I wonder how can I
comment the const. values with the doc-strings. I.e. if I have code:
FRACTION_MIN = 1
FRACTION_MAX = 10
class Fraction(collections.MutableSequence):
Chris Rebert:
Only modules, classes, and functions/methods can have docstrings
associated with them.
For anything else, you have to use comments; or you can mention them
in the docstrings of related things.
What about adding docstrings to other Python things, especially to
variables?
Bye,
Chris Rebert schrieb:
On Sun, Jul 26, 2009 at 2:49 PM, Erwin Muellerdev...@deventm.org wrote:
Hello, I'm new to Python (using it for two months) and I wonder how can I
comment the const. values with the doc-strings. I.e. if I have code:
FRACTION_MIN = 1
FRACTION_MAX = 10
class
On Sun, 26 Jul 2009 15:42:22 -0700, Bearophile wrote:
Chris Rebert:
Only modules, classes, and functions/methods can have docstrings
associated with them.
For anything else, you have to use comments; or you can mention them in
the docstrings of related things.
What about adding docstrings
On Mon, 27 Jul 2009 00:47:08 +0200, Diez B. Roggisch wrote:
Only modules, classes, and functions/methods can have docstrings
associated with them.
For anything else, you have to use comments; or you can mention them in
the docstrings of related things.
While this is technically true,
On 2009-07-26 18:23, Steven D'Aprano wrote:
On Mon, 27 Jul 2009 00:47:08 +0200, Diez B. Roggisch wrote:
Only modules, classes, and functions/methods can have docstrings
associated with them.
For anything else, you have to use comments; or you can mention them in
the docstrings of related