[Python-3000] Octal
Guido van Rossum
guido at python.org
Wed Mar 14 19:58:32 CET 2007
Great! Mind writing up writing up a PEP that summarizes the discussion
(a bit)? In particular it should explain (a) why we need octal
literals; (b) why leading-zero is bad; (c) why we don't need general
bases; (d) why 0t is the best choice. Oh, and please add 0b too;
there's no formal proposal for that yet. Thanks!
--Guido
On 3/14/07, Patrick Maupin <pmaupin at gmail.com> wrote:
> On 3/14/07, Oleg Broytmann <phd at phd.pp.ru> wrote:
> >
> > 0b101010
> > 0c660
> > 0xffe
> >
> > I.e. the first letter from "bin", the second from "oct", the third from
> > "hex". Also "0c" resembles "oc" from "oct".
>
> -1 on "c" It's too visually close to "0" in some fonts.
>
> +1 on "t"
>
> "t" does not appear in 'binary' or 'hexadecimal'
> "x" does not appear in 'binary' or 'octal'
> "b" does not appear in 'octal' or 'hexadecimal'
>
> And finally "c" means "character" in %s or PEP3101, and "t" is not yet
> defined as a type specifier.
>
> So just to couch it all in terms of a proposal:
>
> - In 2.6 and 3.0, we add 0t1234 as a valid octal number
> - In 2.6, we issue a deprecation warning for a leading literal 0 which
> is followed immediately by another digit.
> - In 3.0, that becomes an exception
> - If people really are still using octal that much, we should also
> consider adding it in to PEP3101.
>
> Regards,
> Pat
> _______________________________________________
> Python-3000 mailing list
> Python-3000 at python.org
> http://mail.python.org/mailman/listinfo/python-3000
> Unsubscribe: http://mail.python.org/mailman/options/python-3000/guido%40python.org
>
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-3000
mailing list