[SciPy-dev] numpy.float128 absence yield bugs

dmitrey dmitrey.kroshko at scipy.org
Mon Mar 10 08:57:18 EDT 2008


Matthieu Brucher wrote:
>
>
> 2008/3/10, dmitrey <dmitrey.kroshko at scipy.org 
> <mailto:dmitrey.kroshko at scipy.org>>:
>
>     hi all,
>     if numpy.float128 type is absent (BTW does it related to OS or
>     something
>     else?), it yields bugs even if the type is never used (while importing
>     from a py-file). For example:
>
>     from numpy import ..., float64, float128
>     if (some_cond):
>         <use float128>
>     else: <use float64>
>
>
> If you do not need a direct call to float128 in your condition, you 
> can easily make it compatible on all platforms.
> Do not import numpy with "from numpy import ...", but only "import 
> numpy", make your decision based on cond and the presence of float128 
> ('float128' in dir(numpy)) and everything will be fine ;)
>
> Matthieu
I still think if something is wrong with
from numpy import ...
than it should be found and fixed instead of avoiding the one and 
proposing the solution to other numpy users/programmers.
I guess putting the checks ... in dir(numpy) or hasattr(numpy, float128) 
everywhere isn't a best solution.

Regards, D.



More information about the SciPy-Dev mailing list