[Python-Dev] Octal literals

Barry Warsaw barry at python.org
Wed Feb 1 20:51:41 CET 2006


On Wed, 2006-02-01 at 11:07 -0800, Josiah Carlson wrote:

> In my experience, I've rarely had the opportunity (or misfortune?) to
> deal with negative constants, whose exact bit representation I needed to
> get "just right".  For my uses, I find that specifying "-0x..." or "-..."
> to be sufficient.

I can't remember a time when signed hex, oct, or binary representation
wasn't a major inconvenience, let alone something desirable.  Don't get
me started about hex(id(object()))!  I typically use hex for addresses
and bit fields, binary for bit flags and other bit twiddling, and oct
for OS/file system interfaces.  In none of those cases do you actually
need or want signed values.  IME.

-Barry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part
Url : http://mail.python.org/pipermail/python-dev/attachments/20060201/e9b3cc4a/attachment.pgp 


More information about the Python-Dev mailing list