<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 20, 2018 at 5:08 AM, Richard Purdie <span dir="ltr">&lt;<a href="mailto:richard.purdie@linuxfoundation.org" target="_blank">richard.purdie@linuxfoundation.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, 2018-02-19 at 10:15 -0800, Stephano Cetola wrote:<br>
&gt; From: Amanda Brindle &lt;<a href="mailto:amanda.r.brindle@intel.com">amanda.r.brindle@intel.com</a>&gt;<br>
&gt;<br>
&gt; Before, explode_dep_versions2 would sort the OrderedDict before<br>
&gt; returning. This function will still sort the OrderedDict by default,<br>
&gt; but<br>
&gt; will now have the option to return the OrderedDict unsorted. This<br>
&gt; option will<br>
&gt; allow us to check if the order of the package list has changed.<br>
&gt;<br>
&gt; Signed-off-by: Amanda Brindle &lt;<a href="mailto:amanda.r.brindle@intel.com">amanda.r.brindle@intel.com</a>&gt;<br>
&gt; Acked-by: Stephano Cetola &lt;<a href="mailto:stephano.cetola@linux.intel.com">stephano.cetola@linux.intel.<wbr>com</a>&gt;<br>
&gt; ---<br>
&gt;  lib/bb/utils.py | 5 +++--<br>
&gt;  1 file changed, 3 insertions(+), 2 deletions(-)<br>
&gt;<br>
&gt; diff --git a/lib/bb/utils.py b/lib/bb/utils.py<br>
&gt; index c540b49c..7adb4690 100644<br>
&gt; --- a/lib/bb/utils.py<br>
&gt; +++ b/lib/bb/utils.py<br>
&gt; @@ -187,7 +187,7 @@ def explode_deps(s):<br>
&gt;              #r[-1] += &#39; &#39; + &#39; &#39;.join(j)<br>
&gt;      return r<br>
&gt;  <br>
&gt; -def explode_dep_versions2(s):<br>
&gt; +def explode_dep_versions2(s, unsorted=False):<br>
&gt;      &quot;&quot;&quot;<br>
<br>
</span>Would:<br>
<br>
def explode_dep_versions2(s, sorted=True):<br>
<br>
make things easier to read/understand?<br>
<br>
The &#39;double&#39; logic there currently confuses me a bit.</blockquote><div><br></div><div>sorted=True seems clearer to me as well. I’d also recommend thinking about making this a keyword-only argument, for readability’s sake.</div><div><br></div><div>explode_dep_versions2(s, False) reads pretty unclear, since it loses the info about the meaning of False. Making it keyword only would ensure we’re forced to called it as sorted=False instead.</div></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Christopher Larson<br>kergoth at gmail dot com<br>Founder - BitBake, OpenEmbedded, OpenZaurus<br>Senior Software Engineer, Mentor Graphics</div></div></div></div>
</div></div>