<p dir="ltr">Can we change ">1" to ">=2" to make this clearer?</p>
<div class="gmail_extra"><br><div class="gmail_quote">On Aug 31, 2016 5:33 PM, "Augie Fackler" <<a href="mailto:raf@durin42.com">raf@durin42.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
> On Aug 31, 2016, at 17:19, Kevin Bullock <<a href="mailto:kbullock%2Bmercurial@ringworld.org">kbullock+mercurial@ringworld.<wbr>org</a>> wrote:<br>
><br>
>> On Aug 30, 2016, at 15:16, Augie Fackler <<a href="mailto:raf@durin42.com">raf@durin42.com</a>> wrote:<br>
>><br>
>> # HG changeset patch<br>
>> # User Augie Fackler <<a href="mailto:augie@google.com">augie@google.com</a>><br>
>> # Date 1472586452 14400<br>
>> #      Tue Aug 30 15:47:32 2016 -0400<br>
>> # Node ID c65c0181a9885d3c95e808272c2f60<wbr>9c3a9c8749<br>
>> # Parent  69d84366fa224f5dedfdd18a9f5e24<wbr>13060a8121<br>
>> commands: stop abusing int-ness of Python booleans<br>
>><br>
>> This will break as soon as fancyopts starts returning None for all<br>
>> unspecified boolean flags.<br>
>><br>
>> diff --git a/mercurial/commands.py b/mercurial/commands.py<br>
>> --- a/mercurial/commands.py<br>
>> +++ b/mercurial/commands.py<br>
>> @@ -896,7 +896,8 @@ def bisect(ui, repo, rev=None, extra=Non<br>
>>            bad = True<br>
>>        else:<br>
>>            reset = True<br>
>> -    elif extra or good + bad + skip + reset + extend + bool(command) > 1:<br>
>> +    elif extra or sum(1 for b in (good, bad, skip,<br>
>> +                                  reset, extend, command) if b) > 1:<br>
><br>
> Couldn't we stop abusing math for this at all using any()?<br>
><br>
>    elif extra or any((good, bad, skip, reset, extend, command)):<br>
><br>
> Docs say it was added in Python 2.5.<br>
<br>
No, because we care if *more than one* of the bools was true. I originally had the same idea though.<br>
<br>
><br>
> pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和<br>
> Kevin R. Bullock<br>
><br>
> ______________________________<wbr>_________________<br>
> Mercurial-devel mailing list<br>
> <a href="mailto:Mercurial-devel@mercurial-scm.org">Mercurial-devel@mercurial-scm.<wbr>org</a><br>
> <a href="https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel" rel="noreferrer" target="_blank">https://www.mercurial-scm.org/<wbr>mailman/listinfo/mercurial-<wbr>devel</a><br>
<br>
______________________________<wbr>_________________<br>
Mercurial-devel mailing list<br>
<a href="mailto:Mercurial-devel@mercurial-scm.org">Mercurial-devel@mercurial-scm.<wbr>org</a><br>
<a href="https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel" rel="noreferrer" target="_blank">https://www.mercurial-scm.org/<wbr>mailman/listinfo/mercurial-<wbr>devel</a><br>
</blockquote></div></div>