type-checking support in Python?

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Tue Oct 7 03:38:43 EDT 2008


En Tue, 07 Oct 2008 03:36:12 -0300, Lawrence D'Oliveiro  
<ldo at geek-central.gen.new_zealand> escribió:

> In message <mailman.2089.1223358567.3487.python-list at python.org>, Gabriel
> Genellina wrote:
>
>> As an example, in the oil industry here in my country there is a mix of
>> measurement units in common usage. Depth is measured in meters, but pump
>> stroke in inches; loads in lbs but pressures in kg/cm².
>
> Isn't the right way to handle that to attach dimensions to each number?

Maybe, but I prefer the values to be plain float objects. In my case it's  
not that units are dynamic themselves: "this" file format has depth in  
feet, "that" one uses meters, but that's known from start. I think I'd  
attach units to values if they were dynamic and I had to reproduce the  
original format exactly, but hasn't happened yet (fortunately).

-- 
Gabriel Genellina




More information about the Python-list mailing list