[Python-3000] PEP 3127 (integer literal syntax) -- any takers?

Georg Brandl g.brandl at gmx.net
Sun Jun 10 10:30:30 CEST 2007


Guido van Rossum schrieb:
> On 6/9/07, Georg Brandl <g.brandl at gmx.net> wrote:
>> Guido van Rossum schrieb:
>> > PEP 3127 (Integer Literal Support and Syntax) introduces new notations
>> > for octal and binary integers. This isn't implemented yet. Are there
>> > any takers? It shouldn't be particularly complicated.
>>
>> I have a patch lying around here which might be quite complete...
> 
> Cool!
> 
>> One thing that's unclear to me though: didn't we decide to drop the uppercase
>> string modfiers/number suffixes/prefixes?
> 
> In the end (doesn't the PEP confirms this?) we decided to keep them
> and make it a style rule instead. Some folks have generated data sets
> using uppercase.

The PEP lists it as an "Open Issue".

>> Also, I'm not sure what int() should do with "010".
> 
> int("010") should return (decimal) 10.
> int("010", 0) should raise ValueError.
> 
> I thought that was also in the PEP.

Yes, but rather than follow the PEP blindly, which might not have been updated
to the latest discussion results, asking can't hurt :)

> Anyway, with these tweaks, feel free to just check it in (well, if you
> also fix the standard library to use the new notation).

That should be easy enough.

Georg

-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.



More information about the Python-3000 mailing list