Aaron Watters added the comment:

Okay.  I haven't looked but this should be well documented
somewhere because I found it very surprising (it crashed a large
run somewhere in the middle).

In the case of strings versus unicode I think it is possible
to hack around this by catching the exceptional case and
comparing character by character -- treating out of band
characters as larger than all unicode characters.  I don't
see why this would cause any problems at any rate.

   -- Aaron Watters

On Feb 1, 2008 6:47 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote:

>
> Guido van Rossum added the comment:
>
> > As I understand it comparisons between two objects should
> > always work.
>
> Hi Aaron!  Glad to see you're back.
>
> It used to be that way when you & Jim wrote the first Python book. :-)
>
> Nowadays, comparisons *can* raise exceptions.  Marc-Andre has explained
> why.  In 3.0, this particular issue will go away due to a different
> treatment of Unicode, but many more cases will raise TypeError when < is
> used.  == and != will generally work, though there are no absolute
> guarantees.
>
> ----------
> nosy: +gvanrossum
> resolution:  -> rejected
> status: open -> closed
>
> __________________________________
> Tracker <[EMAIL PROTECTED]>
> <http://bugs.python.org/issue1997>
> __________________________________
>

Added file: http://bugs.python.org/file9348/unnamed

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1997>
__________________________________
Okay.&nbsp; I haven&#39;t looked but this should be well 
documented<br>somewhere because I found it very surprising (it crashed a 
large<br>run somewhere in the middle).<br><br>In the case of strings versus 
unicode I think it is possible<br>
to hack around this by catching the exceptional case and<br>comparing character 
by character -- treating out of band<br>characters as larger than all unicode 
characters.&nbsp; I don&#39;t<br>see why this would cause any problems at any 
rate.<br>
<br>&nbsp;&nbsp; -- Aaron Watters<br><br><div class="gmail_quote">On Feb 1, 
2008 6:47 PM, Guido van Rossum &lt;<a href="mailto:[EMAIL PROTECTED]">[EMAIL 
PROTECTED]</a>&gt; wrote:<br><blockquote class="gmail_quote" 
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; 
padding-left: 1ex;">
<br>Guido van Rossum added the comment:<br><div class="Ih2E3d"><br>&gt; As I 
understand it comparisons between two objects should<br>&gt; always 
work.<br><br></div>Hi Aaron! &nbsp;Glad to see you&#39;re back.<br><br>It used 
to be that way when you &amp; Jim wrote the first Python book. :-)<br>
<br>Nowadays, comparisons *can* raise exceptions. &nbsp;Marc-Andre has 
explained<br>why. &nbsp;In 3.0, this particular issue will go away due to a 
different<br>treatment of Unicode, but many more cases will raise TypeError 
when &lt; is<br>
used. &nbsp;== and != will generally work, though there are no 
absolute<br>guarantees.<br><br>----------<br>nosy: +gvanrossum<br>resolution: 
&nbsp;-&gt; rejected<br>status: open -&gt; closed<br><div><div></div><div 
class="Wj3C7c"><br>
__________________________________<br>Tracker &lt;<a href="mailto:[EMAIL 
PROTECTED]">[EMAIL PROTECTED]</a>&gt;<br>&lt;<a 
href="http://bugs.python.org/issue1997"; 
target="_blank">http://bugs.python.org/issue1997</a>&gt;<br>
__________________________________<br></div></div></blockquote></div><br>

_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to