[issue34810] Maximum and minimum value of C types integers from Python

2022-03-06 Thread Irit Katriel
Irit Katriel added the comment: Closing because there was no reply to questions asking to clarify the use case. Please reopen if you would like to continue the discussion. -- nosy: +iritkatriel resolution: -> wont fix stage: -> resolved status: open -> closed

[issue34810] Maximum and minimum value of C types integers from Python

2018-09-28 Thread Ammar Askar
Ammar Askar added the comment: What is the use case for getting the maximum and minimum of the fixed bit integers like `uint8`? It's a trivial formula to calculate those. Now, if you're talking about platform dependent types like `int` and `long` then it might makes more sense to add such

[issue34810] Maximum and minimum value of C types integers from Python

2018-09-26 Thread Sébastien Celles
Sébastien Celles added the comment: About raising exception with converting integer value that should overflow maybe we should have a parameter ctypes.c_uint8(256, raise=True) will raise an exception but ctypes.c_uint8(256) will silently return c_ubyte(0) --

[issue34810] Maximum and minimum value of C types integers from Python

2018-09-26 Thread Sébastien Celles
Sébastien Celles added the comment: Thanks @serhiy.storchaka I'm aware of this... but I think it could be returned programmatically without much difficulty. -- ___ Python tracker

[issue34810] Maximum and minimum value of C types integers from Python

2018-09-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Maximum values for uint8, int8, uint16, int16, uint32, int32, uint64, int64 are 2**8-1, 2**7-1, 2**16-1, 2**15-1, 2**32-1, 2**31-1, 2**64-1, 2**63-1 by definition. Minimum values are 0, -2**7, 0, -2**15, 0, -2**31, 0, -2**63. -- nosy:

[issue34810] Maximum and minimum value of C types integers from Python

2018-09-26 Thread Sébastien Celles
New submission from Sébastien Celles : Hello, I'm looking for a way to get (using Python) the maximum and minimum values of C types integers (ie uint8, int8, uint16, int16, uint32, int32, uint64, int64...) from Python. I asked this question on StackOverflow and get a nice answer