Hi Chris,

as far as my understanding of python goes this does not make any difference.
Strings are essentially arrays in python which would make the parenthesis 
obsolete.

When this condition should catch another type in the future it would be good 
practice to do something like this:

If options.type in ['script', '<other-type>']:

Even though the following would be functional the same but obviously much less 
readable and logical:

If options.type in 'script<other-type>':

Best regards
André

-----Ursprüngliche Nachricht-----
Von: Chris Johns <chr...@rtems.org> 
Gesendet: Dienstag, 16. Februar 2021 21:29
An: Sommer, Jan <jan.som...@dlr.de>; devel@rtems.org
Cc: Nahrwold, Andre <andre.nahrw...@dlr.de>
Betreff: Re: [PATCH 1/1] misc: tools: fix mkimage.py script type processing

On 12/2/21 3:23 am, Jan Sommer wrote:
> From: Andre Nahrwold <andre.nahrw...@dlr.de>
> 
> ---
>  misc/tools/mkimage.py | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/misc/tools/mkimage.py b/misc/tools/mkimage.py index 
> fd75f0a..111e224 100755
> --- a/misc/tools/mkimage.py
> +++ b/misc/tools/mkimage.py
> @@ -121,6 +121,16 @@ outputfile.seek(struct.size);
>  
>  inputcrc = 0;
>  
> +if options.type in 'script':

I saw this and thought it might be wrong and now I think it is. Should this 
line be:

 > +if options.type in ['script']:

?

Chris
_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to