Numeric literals in other than base 10 - was Annoying octal notation
Erik Max Francis
max at alcyone.com
Mon Aug 24 04:30:11 EDT 2009
James Harris wrote:
> On 24 Aug, 09:05, Erik Max Francis <m... at alcyone.com> wrote:
>>>> Here's another suggested number literal format. First, keep the
>>>> familar 0x and 0b of C and others and to add 0t for octal. (T is the
>>>> third letter of octal as X is the third letter of hex.) The numbers
>>>> above would be
>>>> 0b1011, 0t7621, 0xc26b
>>>> Second, allow an arbitrary number base by putting base and number in
>>>> quotes after a zero as in
>>>> 0"2:1011", 0"8:7621", 0"16:c26b"
>>> Why not just put the base first, followed by the value in quotes:
>>> 2"1011", 8"7621", 16"c26b"
>> It's always a bit impressive how syntax suggestions get more and more
>> involved and, if you'll forgive me for saying, ridiculous as the
>> conversation continues. This is starting to get truly nutty.
>
> Why do you say that here? MRAB's suggestion is one of the clearest
> there has been. And it incorporates the other requirements: starts
> with a digit, allows an appropriate alphabet, has no issues with
> spacing digit groups, shows clearly where the number ends and could
> take an exponent suffix.
In your opinion. Obviously not in others. Which is pretty obviously
what I meant, so the rhetorical question is a bit weird here.
There's a reason that languages designed by committee end up horrific
nightmares.
--
Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis
Do not seek death. Death will find you.
-- Dag Hammarskjold
More information about the Python-list
mailing list