str(bytes) in Python 3.0
Kay Schluehr
kay.schluehr at gmx.net
Sat Apr 12 11:51:04 EDT 2008
On 12 Apr., 16:29, Carl Banks <pavlovevide... at gmail.com> wrote:
> > And making an utf-8 encoding default is not possible without writing a
> > new function?
>
> I believe the Zen in effect here is, "In the face of ambiguity, refuse
> the temptation to guess." How do you know if the bytes are utf-8
> encoded?
How many "encodings" would you define for a Rectangle constructor?
Making things infinitely configurable is very nice and shows that the
programmer has worked hard. Sometimes however it suffices to provide a
mandatory default and some supplementary conversion methods. This
still won't exhaust all possible cases but provides a reasonable
coverage.
More information about the Python-list
mailing list