[SciPy-dev] numpy.float128 absence yield bugs

dmitrey dmitrey.kroshko@scipy....
Mon Mar 10 07:57:18 CDT 2008


Matthieu Brucher wrote:
>
>
> 2008/3/10, dmitrey <dmitrey.kroshko@scipy.org 
> <mailto:dmitrey.kroshko@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