AW: [PATCH 1/1] misc: tools: fix script type processing

Andre.Nahrwold at Andre.Nahrwold at
Wed Feb 17 07:34:45 UTC 2021

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

-----Ursprüngliche Nachricht-----
Von: Chris Johns <chrisj at> 
Gesendet: Dienstag, 16. Februar 2021 21:29
An: Sommer, Jan <Jan.Sommer at>; devel at
Cc: Nahrwold, Andre <Andre.Nahrwold at>
Betreff: Re: [PATCH 1/1] misc: tools: fix script type processing

On 12/2/21 3:23 am, Jan Sommer wrote:
> From: Andre Nahrwold <andre.nahrwold at>
> ---
>  misc/tools/ | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> diff --git a/misc/tools/ b/misc/tools/ index 
> fd75f0a..111e224 100755
> --- a/misc/tools/
> +++ b/misc/tools/
> @@ -121,6 +121,16 @@;
>  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']:



More information about the devel mailing list