patch updated (hopefully for the last time. it got me all bored :)<br><br><br><div><span class="gmail_quote">On 11/21/06, <b class="gmail_sendername">Brett Cannon</b> <<a href="mailto:brett@python.org">brett@python.org</a>
> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><br><div><span class="q"><span class="gmail_quote">On 11/21/06, <b class="gmail_sendername">
Walter Dörwald</b> <<a href="mailto:walter@livinglogic.de" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">walter@livinglogic.de</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
tomer filiba wrote:<br>> patch updated<br><br>You're fast! ;)<br><br>AFAICT now we have the following problem: If<br>Objects/typeobject.c::slot_nb_bool() falls back to using __len__(), the<br>return value of __len__() must be a bool.
</blockquote></span><div><br>Why can't the fallback usage just pass the return value from __len__ to bool() (forget the C function name) and return that result? It's just like doing::<br><br> def bool(obj):<br> try:
<br> return obj.__bool__()
<br> except AttributeError:<br> return bool(len(obj))<br><br>-Brett<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><span class="e" id="q_10f0c37df0731fe1_3">
Servus,<br> Walter<br><br>> On 11/21/06, *Guido van Rossum* <<a href="mailto:guido@python.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">guido@python.org</a><br>> <mailto:<a href="mailto:guido@python.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
guido@python.org</a>>> wrote:<br>><br>
> I think it would set a good example if __bool__ was *required* to<br>> return exactly True or False and no other object, not even int<br>> instances equal to 0 or 1. Surely that can't be much of a burden. Feel
<br>> free to upload an improved patch.<br>><br>> On 11/21/06, Walter Dörwald <<a href="mailto:walter@livinglogic.de" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">walter@livinglogic.de
</a><br>> <mailto:<a href="mailto:walter@livinglogic.de" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
walter@livinglogic.de</a>>> wrote:<br>> > Guido van Rossum wrote:<br>> > > On 11/21/06, Ivan Krstiæ < <a href="mailto:krstic@solarsail.hcs.harvard.edu" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
krstic@solarsail.hcs.harvard.edu</a><br>
> <mailto:<a href="mailto:krstic@solarsail.hcs.harvard.edu" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">krstic@solarsail.hcs.harvard.edu</a>>> wrote:<br>> > >> Guido van Rossum wrote:
<br>> > >>> Can anyone help out evaluating this patch? If it has to wait
<br>> for me<br>> > >>> it's gonna be a looooooong wait...<br>> > >> Looks fine to me functionally, although it seems to<br>> gratuitously retab<br>> > >> some code that used to be aligned with tabstop 8 to a tabstop of 4.
<br>> > ><br>> > > Thanks! I hope you meant "indentation level" instead of "tabstop".<br>> > > Tomer, can you fix the indentation to be whatever's prevailing<br>
> in the
<br>> > > file you're editing?<br>> ><br>> > Another question is whether __bool__() should be allowed to return an<br>> > int (or any other object), or if it *must* be a bool. (The patch
<br>> > currently allows ints). What if __bool__() returns subclasses of int,<br>> > that overwrite __bool__() themself?<br>> ><br>> > Servus,<br>> > Walter<br>> >
<br>> ><br>><br>><br>> --<br>> --Guido van Rossum (home page: <a href="http://www.python.org/%7Eguido/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.python.org/~guido/
</a>)<br>><br>><br><br></span></div>_______________________________________________
<span class="q"><br>Python-3000 mailing list<br><a href="mailto:Python-3000@python.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Python-3000@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/python-3000" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://mail.python.org/mailman/listinfo/python-3000</a><br></span>
Unsubscribe: <a href="http://mail.python.org/mailman/options/python-3000/brett%40python.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://mail.python.org/mailman/options/python-3000/brett%40python.org
</a><br></blockquote></div><br>
</blockquote></div><br>