[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)

--

___
Python tracker 
<https://bugs.python.org/issue34810>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 
<https://bugs.python.org/issue34810>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 
https://stackoverflow.com/questions/52475749/maximum-and-minimum-value-of-c-types-integers-from-python

but I wonder if this kind of feature couldn't be add directly in `ctypes.c_` as 
property.

Maybe we could have the following properties:
- `issigned`
- `max`
- `min`

Moreover being able to convert a number into a C type integer raising exception 
when input data is out of range could also be considered
Maybe using code like https://pastebin.com/cvm95m1x
(instead of silently overflow)

Kind regards

--
messages: 326467
nosy: scls
priority: normal
severity: normal
status: open
title: Maximum and minimum value of C types integers from Python

___
Python tracker 
<https://bugs.python.org/issue34810>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24633] Not a directory: '//anaconda/lib/python2.7/site-packages/readme/__about__.py'

2015-07-14 Thread Sébastien Celles

New submission from Sébastien Celles:

Hello,

the package name readme conflicts with Python installed site-packages/README 
file on case-insensitive filesystems (Mac OS X).

https://github.com/pypa/readme/issues/26
https://github.com/mgedmin/restview/issues/30
https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/AGHXzB1sN0I

I wonder if README file should be be renamed README.rst or README.txt or 
README.md to avoid this issue or if readme package should be renamed.

Kind regards

--
components: Macintosh
messages: 246721
nosy: Sébastien Celles, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Not a directory: 
'//anaconda/lib/python2.7/site-packages/readme/__about__.py'
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24633
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com