On 13 Apr., 09:24, Carl Banks <[EMAIL PROTECTED]> wrote:
> On Apr 12, 11:51 am, Kay Schluehr <[EMAIL PROTECTED]> wrote:
>
> > On 12 Apr., 16:29, Carl Banks <[EMAIL PROTECTED]> wrote:
>
> > > > And making an utf-8 encoding default is not possible without writing a
> > > > new function?
>
> > > I bel
On Apr 12, 11:51 am, Kay Schluehr <[EMAIL PROTECTED]> wrote:
> On 12 Apr., 16:29, Carl Banks <[EMAIL PROTECTED]> 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
> >
"John Roth" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| On Apr 12, 8:52 am, [EMAIL PROTECTED] (John J. Lee) wrote:
| > Christian Heimes <[EMAIL PROTECTED]> writes:
| > > Gabriel Genellina schrieb:
| > >> On the last line, str(x), I would expect 'abc' - same as str(x,
'ascii')
|
En Sat, 12 Apr 2008 11:25:59 -0300, Martin v. Löwis <[EMAIL PROTECTED]>
escribió:
>> And making an utf-8 encoding default is not possible without writing a
>> new function?
>
> There is no default encoding anymore in Python 3. This is by design,
> learning from the problems in Python 2.x.
So sy
Dan Bishop wrote:
> On Apr 12, 9:29 am, Carl Banks <[EMAIL PROTECTED]> wrote:
>> On Apr 12, 10:06 am, Kay Schluehr <[EMAIL PROTECTED]> wrote:
>>
>>> On 12 Apr., 14:44, Christian Heimes <[EMAIL PROTECTED]> wrote:
Gabriel Genellina schrieb:
> On the last line, str(x), I would expect 'abc' -
On Apr 12, 9:29 am, Carl Banks <[EMAIL PROTECTED]> wrote:
> On Apr 12, 10:06 am, Kay Schluehr <[EMAIL PROTECTED]> wrote:
>
> > On 12 Apr., 14:44, Christian Heimes <[EMAIL PROTECTED]> wrote:
>
> > > Gabriel Genellina schrieb:
>
> > > > On the last line, str(x), I would expect 'abc' - same as str(x,
On Apr 12, 8:52 am, [EMAIL PROTECTED] (John J. Lee) wrote:
> Christian Heimes <[EMAIL PROTECTED]> writes:
> > Gabriel Genellina schrieb:
> >> On the last line, str(x), I would expect 'abc' - same as str(x, 'ascii')
> >> above. But I get the same as repr(x) - is this on purpose?
>
> > Yes, it's on p
On Apr 12, 5:51 pm, Kay Schluehr <[EMAIL PROTECTED]> wrote:
> On 12 Apr., 16:29, Carl Banks <[EMAIL PROTECTED]> 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
> >
On 12 Apr., 16:29, Carl Banks <[EMAIL PROTECTED]> 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
> enc
John J. Lee schrieb:
> Why hasn't the one-argument str(bytes_obj) been designed to raise an
> exception in Python 3?
See for yourself:
$ ./python
Python 3.0a4+ (py3k:0, Apr 11 2008, 15:31:31)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits"
Carl Banks schrieb:
> 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?
Indeed
> I'm not sure if str() returning the repr() of a bytes object (when not
> passed an encoding) is the right thing, but
Christian Heimes <[EMAIL PROTECTED]> writes:
> Gabriel Genellina schrieb:
>> On the last line, str(x), I would expect 'abc' - same as str(x, 'ascii')
>> above. But I get the same as repr(x) - is this on purpose?
>
> Yes, it's on purpose but it's a bug in your application to call str() on
> a byt
On Apr 12, 10:06 am, Kay Schluehr <[EMAIL PROTECTED]> wrote:
> On 12 Apr., 14:44, Christian Heimes <[EMAIL PROTECTED]> wrote:
>
> > Gabriel Genellina schrieb:
>
> > > On the last line, str(x), I would expect 'abc' - same as str(x, 'ascii')
> > > above. But I get the same as repr(x) - is this on pur
> And making an utf-8 encoding default is not possible without writing a
> new function?
There is no default encoding anymore in Python 3. This is by design,
learning from the problems in Python 2.x.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
On 12 Apr., 14:44, Christian Heimes <[EMAIL PROTECTED]> wrote:
> Gabriel Genellina schrieb:
>
> > On the last line, str(x), I would expect 'abc' - same as str(x, 'ascii')
> > above. But I get the same as repr(x) - is this on purpose?
>
> Yes, it's on purpose but it's a bug in your application to ca
Gabriel Genellina schrieb:
> On the last line, str(x), I would expect 'abc' - same as str(x, 'ascii')
> above. But I get the same as repr(x) - is this on purpose?
Yes, it's on purpose but it's a bug in your application to call str() on
a bytes object or to compare bytes and unicode directly. Sev
Hello
Is this the intended behavior?
Python 3.0a4+ (py3k, Apr 12 2008, 02:53:16) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> x = b"abc"
>>> repr(x)
"b'abc'"
>>> str(x,"ascii")
'abc'
>>> str(x,"utf-8")
'abc'
>>> str(x)
"b'abc'"
17 matches
Mail list logo