[Python-3000] PEP 3137 plan of attack

Guido van Rossum guido at python.org
Tue Oct 9 19:02:03 CEST 2007


On 10/9/07, Thomas Lee <tom at vector-seven.com> wrote:
> 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? :)

Sorry, my bad. I misread and though you were talking about PyString vs. PyBytes.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list