[Python-Dev] Octal literals (original) (raw)

Barry Warsaw barry at python.org
Wed Feb 1 19:35:14 CET 2006


On Wed, 2006-02-01 at 09:47 -0800, Josiah Carlson wrote:

I hope I'm not the only one who thinks that "simple is better than complex", at least when it comes to numeric constants. Certainly it would be convenient to express constants in a radix other than decimal, hexidecimal, or octal, but to me, it all looks like noise.

As a Unix weenie and occasional bit twiddler, I've had needs for octal, hex, and binary literals. +1 for coming up with a common syntax for these. -1 on removing any way to write octal literals.

The proposal for something like 0xff, 0o664, and 0b1001001 seems like the right direction, although 'o' for octal literal looks kind of funky. Maybe 'c' for oCtal? (remember it's 'x' for heXadecimal).

-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/8d8dff84/attachment.pgp



More information about the Python-Dev mailing list