Re: [PATCH v8 04/13] tools: ynl_gen_rst.py: cleanup coding style

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mauro Carvalho Chehab <mchehab+huawei@xxxxxxxxxx> writes:

>      @staticmethod
>      def rst_ref(namespace: str, prefix: str, name: str) -> str:
>          """Add a hyperlink to the document"""
> @@ -119,10 +100,9 @@ class RstFormatters:
>                      'nested-attributes': 'attribute-set',
>                      'struct': 'definition'}
>          if prefix in mappings:
> -            prefix = mappings[prefix]
> +            prefix = mappings.get(prefix, "")

This gives me a sad face because fixing the erroneous pylint warning
makes the code look worse. I'd prefer to either suppress the warning
or to change this:

        if prefix in mappings:
            prefix = mappings[prefix]

to this:

        prefix = mappings.get(prefix, prefix)

But IMHO the intent of the original is clearer.




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux