Mark Dickinson <dicki...@gmail.com> added the comment:

The out-of-range error messages for unsigned short and short have been fixed, 
thanks to Nikita Sobolev. They resulted from a rather odd use of the 
Py_STRINGIFY macro, which meant that not only were the messages obscure, but 
they differed from system to system: e.g., on my machine I get: "struct.error: 
ushort format requires 0 <= number <= (32767 *2 +1)", and "struct.error: short 
format requires (-32767 -1) <= number <= 32767", complete with the weird 
spacing.

There's still room for normalising the other messages and/or converting the 
limits to hex if anyone wants to provide a PR.

I'm unsure about using hex universally: while `0xffffffffffffffff` (or even 
better, `0xffff_ffff_ffff_ffff`) is definitely more useful than 
`18446744073709551615`, I think I'd still find `-128` more immediately readable 
than `-0x80`.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45034>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to