[Python-3000] PEP 3137 plan of attack
Thomas Lee
tom at vector-seven.com
Tue Oct 9 18:19:13 CEST 2007
Guido van Rossum wrote:
>
> The point is that a bytes and a str instance are never considered equal...
>
>
Sorry. I understand now. My brain must have been on a holiday earlier.
:) Just pushed an updated patch to the bug tracker.
>> str8() == str() -> False
>> str8() != str() -> True
>>
>> Correct?
>>
>
> Well, in this case you actually have to compare the individual bytes.
> But yes. ;-)
>
I'm confused: if I'm making == and != between PyString return False
instead of converting, at what point would I need to be comparing bytes?
The fix I have ready for this merely wipes out the conversion from
PyString to PyUnicode in PyUnicode_Compare and the existing code takes
care of the rest. Is this all that's required, or have I misinterpreted
this one too? :)
Cheers,
Tom
More information about the Python-3000
mailing list