tswast opened a new issue, #50454:
URL: https://github.com/apache/arrow/issues/50454

   ### Describe the enhancement requested
   
   The built-in [numbers 
module](https://docs.python.org/3/library/numbers.html#module-numbers) provides 
abstract base classes for checking for various kinds of numbers. It would be 
helpful if pyarrow integer scalar values derived from these classes for more 
robust checks in code that might accept pyarrow values.
   
   ```
   In [1]: import numpy as np
   
   In [2]: import numbers
   
   In [3]: isinstance(123, numbers.Integral)
   Out[3]: True
   
   In [6]: v = np.int64(123)
   
   In [7]: isinstance(v, numbers.Integral)
   Out[7]: True
   
   In [8]: isinstance(v, int)
   Out[8]: False
   
   In [9]: import pyarrow as pa
   
   In [10]: vv = pa.scalar(123)
   
   In [11]: vv
   Out[11]: <pyarrow.Int64Scalar: 123>
   
   In [13]: isinstance(vv, numbers.Integral)
   Out[13]: False
   ```
   
   ### Component(s)
   
   Python


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to