How to comment constant values?

E

Erwin Mueller

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 denomintors in a list for quick access.
The class is thread save, it uses a lock for all operations.
'''

def __init__(self):
# ...

The class and the methods can have doc-strings, but what about the const.
values, FRACTION_MIN and FRACTION_MAX?

Thank you, Erwin.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,156
Latest member
KetoBurnSupplement
Top