are docstrings for variables a bad idea?

jelle jelleferinga at gmail.com
Fri Apr 21 09:31:13 EDT 2006


----
class GeographicCoordinate:
    def __init__ (self, lat, long):
        self.lat = lat "Latitude in degrees (positive North), per
WGS84"
        self.long = long "Longitude in degrees (positive West), per
WGS84"
----

Thanks for your example Roy, that illustrates well what I'm after:
self.lat = lat "ellipsoid reference: WGS84\nGRS 80 no longer supported"

It does exactly what its intended to do: i had no clue what the World
Geodetic System and would have asserted my input with a GRS80_2_WGS84
function

Little notes to avoid major mistakes.

class landClimateOrbiter(NASA):

        self.speed = self.unit * x

Just imagine 'feet' would have popped up when typing self.unit




More information about the Python-list mailing list