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

Guido van Rossum guido at python.org
Sat Jun 9 17:39:11 CEST 2007


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.

> 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.

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

--Guido

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list