<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
On Wed, May 5, 2021 at 10:15 PM Chris Johns <chrisj@rtems.org> wrote:<br>
><br>
> On 6/5/21 4:49 am, Gedare Bloom wrote:<br>
> > On Wed, May 5, 2021 at 9:16 AM Alex White <alex.white@oarcorp.com> wrote:<br>
> >><br>
> >> On Wed, May 5, 2021 at 9:47 AM Gedare Bloom <gedare@rtems.org> wrote:<br>
> >>><br>
> >>> Why?<br>
> >><br>
> >> To prevent the '--mail' and '--use-gitconfig' options from being added more than once to the ArgumentParser in add_arguments.<br>
> >><br>
> > How does that happen?<br>
> ><br>
> > I'm not trying to be frustrating (just annoying). I want to be sure<br>
> > we're using the right solution for the right problem, and not just<br>
> > putting a bandaid over something so it works while we hide some<br>
> > underlying concerns.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
It happened because I did not know about the lack of a dictionary key ordering guarantee in Python (at least before 3.6 I believe) and because I forgot to update the start index for iterating the keys. I will take Chris's approach below.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
><br>
> Gedare, I am agree. I think there maybe another simpler solution.<br>
><br>
> Why not make the list() be something like ...<br>
><br>
> no_add = ['--mail', '--use-gitconfig']<br>
> for o in [opt for opt in list(_options) if not in no_add]:<br>
> ..<br>
><br>
> ... or something like that?</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
This seems more reliable as it avoids the magic number in the loop and should avoid introducing problems like this in the future. I'll get a v2 out with this added.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Alex</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
><br>
> Chris<br>
> _______________________________________________<br>
> devel mailing list<br>
> devel@rtems.org<br>
> <a href="http://lists.rtems.org/mailman/listinfo/devel" id="LPlnk637425">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</div>
</body>
</html>