def build_class(table):
    "build a class for each table i.e. Distance,Velocity,etc."
    name, baseunits = table[0]
    s = '\nclass %(name)s(Decimal):\n' % locals()
    s += '    __slots__ = ("_update",) # generate AttributeError on illegal property; example: if d.yds instead of d.ydgenerate AttributeError example: if d.yds not d.yd\n'
    return s
build a class for each table i.e. Distance,Velocity,etc.
recipes/Python/577652_Unit_Conversions_Using_Decimal/recipe-577652.py