On Tue, Apr 15, 2008 at 2:56 PM, Mark Dickinson <[EMAIL PROTECTED]> wrote:
>
> On Tue, Apr 15, 2008 at 2:37 PM, Gregory P. Smith <[EMAIL PROTECTED]> wrote:
> > Agreed.  Otherwise the common ascii based network protocol task of reading
> some bytes in and converting them to the integer that they represent in
> ascii would require an additional unicode decoding step.
> >
>
> This use-case doesn't seem particularly convincing when the reverse step of
> converting an integer to an (ascii) bytes instance still has to go through
> unicode.
> Maybe there should be an int.to_ascii method?

Input and output are often wildly asymmetric anyway. It's easy to make
int() and float() accept more input types. But making them return a
different output type is different. I find the existing work-arounds
good enough not to propose a whole new API. If we end up deciding to
add one anyway, I don't think that to_ascii is a good name; it doesn't
imply the type of the result, since ASCII text can also be (and
usually is) represented as a (Unicode) str instance.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to