are docstrings for variables a bad idea?

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Fri Apr 21 08:24:00 EDT 2006


Docstrings for variables seems a new interesting idea to me, but I
don't know how much useful it can be. Do you mean something like this?

>>> rcar_speed = 25
>>> print rcar_speed
25
>>> print rcar_speed.__doc__
int(x[, base]) -> integer
...
>>> rcar_speed.__ndoc__ = "Speed of the red car, km/h"
...

Can you show me some examples of its possible usefulness?

Bye,
bearophile




More information about the Python-list mailing list