1414import inspect
1515from .library import *
1616from .util import *
17- from .bcast import *
17+ from .util import _is_number
18+ from .bcast import _bcast_var
1819from .base import *
1920from .index import *
2021from .index import _Index4
@@ -75,31 +76,31 @@ def _binary_func(lhs, rhs, c_func):
7576 out = Array ()
7677 other = rhs
7778
78- if (is_number (rhs )):
79+ if (_is_number (rhs )):
7980 ldims = dim4_to_tuple (lhs .dims ())
8081 rty = implicit_dtype (rhs , lhs .type ())
8182 other = Array ()
8283 other .arr = constant_array (rhs , ldims [0 ], ldims [1 ], ldims [2 ], ldims [3 ], rty .value )
8384 elif not isinstance (rhs , Array ):
8485 raise TypeError ("Invalid parameter to binary function" )
8586
86- safe_call (c_func (ct .pointer (out .arr ), lhs .arr , other .arr , bcast_var .get ()))
87+ safe_call (c_func (ct .pointer (out .arr ), lhs .arr , other .arr , _bcast_var .get ()))
8788
8889 return out
8990
9091def _binary_funcr (lhs , rhs , c_func ):
9192 out = Array ()
9293 other = lhs
9394
94- if (is_number (lhs )):
95+ if (_is_number (lhs )):
9596 rdims = dim4_to_tuple (rhs .dims ())
9697 lty = implicit_dtype (lhs , rhs .type ())
9798 other = Array ()
9899 other .arr = constant_array (lhs , rdims [0 ], rdims [1 ], rdims [2 ], rdims [3 ], lty .value )
99100 elif not isinstance (lhs , Array ):
100101 raise TypeError ("Invalid parameter to binary function" )
101102
102- c_func (ct .pointer (out .arr ), other .arr , rhs .arr , bcast_var .get ())
103+ c_func (ct .pointer (out .arr ), other .arr , rhs .arr , _bcast_var .get ())
103104
104105 return out
105106
@@ -172,7 +173,7 @@ def _get_assign_dims(key, idims):
172173 for n in range (len (idims )):
173174 dims [n ] = idims [n ]
174175
175- if is_number (key ):
176+ if _is_number (key ):
176177 dims [0 ] = 1
177178 return dims
178179 elif isinstance (key , slice ):
@@ -188,7 +189,7 @@ def _get_assign_dims(key, idims):
188189 n_inds = len (key )
189190
190191 for n in range (n_inds ):
191- if (is_number (key [n ])):
192+ if (_is_number (key [n ])):
192193 dims [n ] = 1
193194 elif (isinstance (key [n ], BaseArray )):
194195 dims [n ] = key [n ].elements ()
@@ -891,7 +892,7 @@ def __setitem__(self, key, val):
891892 try :
892893 n_dims = self .numdims ()
893894
894- if (is_number (val )):
895+ if (_is_number (val )):
895896 tdims = _get_assign_dims (key , self .dims ())
896897 other_arr = constant_array (val , tdims [0 ], tdims [1 ], tdims [2 ], tdims [3 ], self .type ())
897898 del_other = True
0 commit comments