On 3/9/2012 4:57 PM, Steven D'Aprano wrote:
On Fri, 09 Mar 2012 10:11:58 -0800, John Nagle wrote:
This demonstrates a gross confusion about both Unicode and Python. John,
I honestly don't mean to be rude here, but if you actually believe that
(rather than merely expressing yourself poorly), then
On Fri, 09 Mar 2012 10:11:58 -0800, John Nagle wrote:
> On 3/8/2012 2:58 PM, Prasad, Ramit wrote:
>>> Right. The real problem is that Python 2.7 doesn't have distinct
>>> "str" and "bytes" types. type(bytes() returns "str" is
>>> assumed to be ASCII 0..127, but that's not enforced. "bytes" a
On 3/8/2012 2:58 PM, Prasad, Ramit wrote:
Right. The real problem is that Python 2.7 doesn't have distinct
"str" and "bytes" types. type(bytes() returns
"str" is assumed to be ASCII 0..127, but that's not enforced.
"bytes" and "str" should have been distinct types, but
that would have broke
On 2012-03-08, John Nagle wrote:
> So it's possible to get junk characters in a "str", and they
> won't convert to Unicode. I've had this happen with databases
> which were supposed to be ASCII, but occasionally a non-ASCII
> character would slip through.
Perhaps encode and then decode, rather t
n Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423
--
> -Original Message-
> From: python-list-bounces+ramit.prasad=jpmorgan@python.org
> [mailto:python-list-bounces+ramit.prasad=jpmorgan@python.org] On Behalf
>
On 3/7/2012 6:18 PM, Ben Finney wrote:
Steven D'Aprano writes:
On Thu, 08 Mar 2012 08:48:58 +1100, Ben Finney wrote:
I think that's a Python bug. If the latter succeeds as a no-op, the
former should also succeed as a no-op. Neither should ever get any
errors when ‘s’ is a ‘unicode’ object alr
Steven D'Aprano writes:
> On Thu, 08 Mar 2012 08:48:58 +1100, Ben Finney wrote:
> > I think that's a Python bug. If the latter succeeds as a no-op, the
> > former should also succeed as a no-op. Neither should ever get any
> > errors when ‘s’ is a ‘unicode’ object already.
>
> No. The semantics o
On 3/7/2012 6:26 PM, Steven D'Aprano wrote:
On Thu, 08 Mar 2012 08:48:58 +1100, Ben Finney wrote:
John Nagle writes:
The library bug, if any, is that you can't apply
unicode(s, errors='replace')
to a Unicode string. TypeError("Decoding unicode is not supported") is
raised. How
On Thu, 08 Mar 2012 08:48:58 +1100, Ben Finney wrote:
> John Nagle writes:
>
>>The library bug, if any, is that you can't apply
>>
>> unicode(s, errors='replace')
>>
>> to a Unicode string. TypeError("Decoding unicode is not supported") is
>> raised. However
>>
>> unicode(s)
>>
>>
John Nagle writes:
>The library bug, if any, is that you can't apply
>
> unicode(s, errors='replace')
>
> to a Unicode string. TypeError("Decoding unicode is not supported") is
> raised. However
>
> unicode(s)
>
> will accept Unicode input.
I think that's a Python bug. If the la
On 3/7/2012 3:42 AM, Steven D'Aprano wrote:
I *think* he is complaining that some other library -- suds? -- has a
broken test for Unicode, by using:
if type(s) is unicode: ...
instead of
if isinstance(s, unicode): ...
Consequently, when the library passes a unicode *subclass* to the
tounicod
On Wed, 07 Mar 2012 22:18:50 +1100, Ben Finney wrote:
> de...@web.de (Diez B. Roggisch) writes:
>
>> John Nagle writes:
>>
>> > I think that somewhere in "suds", they subclass the "unicode" type.
>> > That's almost too cute.
>> >
>> > The proper test is
>> >
>> >isinstance(s,unicode)
>>
>> W
de...@web.de (Diez B. Roggisch) writes:
> John Nagle writes:
>
> > I think that somewhere in "suds", they subclass the "unicode" type.
> > That's almost too cute.
> >
> > The proper test is
> >
> > isinstance(s,unicode)
>
> Woot, you finally discovered polymorphism - congratulations!
If by “
John Nagle writes:
> I think that somewhere in "suds", they subclass the "unicode" type.
> That's almost too cute.
>
> The proper test is
>
> isinstance(s,unicode)
Woot, you finally discovered polymorphism - congratulations!
Diez
--
http://mail.python.org/mailman/listinfo/python-list
14 matches
Mail list logo