def _convert_to(l, dest_unit="m"):
if type(l) in (types.IntType, types.LongType, types.FloatType):
return l * _m[_default_unit] * scale['u'] / _m[dest_unit]
elif not isinstance(l, length):
l = length(l) # convert to length instance if necessary
return (l.t + l.u*scale['u'] + l.v*scale['v'] + l.w*scale['w'] + l.x*scale['x']) / _m[dest_unit]
评论列表
文章目录