On 10/9/07, Thomas Lee <[EMAIL PROTECTED]> wrote:
> Thomas Lee wrote:
> > Guido van Rossum wrote:
> >
> >> - make == and != between PyBytes and PyUnicode return False instead of
> >> raising TypeError
> >>
> A patch for this is ready. I'll submit it to the bug tracker later tonight.
> >> - make == and != between PyString and Pyunicode return False instead
> >> of converting
> >>
> This will be trivial, but I need to ask a stupid question: is this also
> true for PyUnicode_Compare? (i.e. should PyUnicode_Compare(str8(),
> str()) != 0 ?)
>
> And, if so, what should PyUnicode_Compare actually return if one of the
> parameters is a PyString? Maybe -1 for PyUnicode on the left, 1 for
> PyUnicode on the right?
Assuming that PyUnicode_Compare is a three-way comparison (less,
equal, more), it should raise a TypeError when one of the arguments is
a PyString or PyBytes.
> >> - make comparisons between PyString and PyBytes work (these are
> >> properly ordered)
> >>
> >>
> Is it just me, or do string/bytes comparisons already work?
>
> >>> s = str8('test')
> >>> b = b'test'
> >>> s == b
> True
> >>> b == s
> True
> >>> s != b
> False
> >>> b != s
> False
Seems it's already so. Do they order properly too? (< <= > >=)
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com