[Python-3000] PyBuffer ndim unsigned
Stephen J. Turnbull
stephen at xemacs.org
Tue Aug 28 04:09:00 CEST 2007
Gregory P. Smith writes:
> heh good point. ignore that thought. python is a signed language. :)
For what little it's worth, I object strongly. The problem isn't
Python, it's C. Because the rules give unsigned precedence over
signed in implicit conversions, mixed signed/unsigned arithmetic in C
is just a world of pain. It's especially dangerous when dealing with
Unix-convention stream functions where non-negative returns are
lengths and negative returns are error codes. Often the only
indication you get is one of those stupid "due to insufficient range
of type comparison is always true" warnings.
In my experience except when dealing with standard functions of
unsigned type, it's best to avoid unsigned like the plague. It's
worth the effort of doing a range check on an unsigned return and then
stuffing it into a signed if you got one big enough.
Sign me ... "Escaped from Unsigned Purgatory in XEmacs"
More information about the Python-3000