def a(self, other): try: if self.__array_priority__ < other.__array_priority__: return NotImplemented except AttributeError: pass if isnumber(other): a, b = self, other else: a, b = make_same_dims(self, self.__class__(other)) return func(a, b)
def test_isnumber_float(self): self.assertTrue(utils.isnumber(19.))
def test_isnumber_cplx(self): self.assertTrue(utils.isnumber(19. + 1j))
def test_isnumber_int(self): self.assertTrue(utils.isnumber(19))