bug-gnulib
[Top][All Lists]
Advanced

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

Re: gnulib-tool.py: Ignore pylint 'unidiomatic-typecheck' warnings.


From: Bruno Haible
Subject: Re: gnulib-tool.py: Ignore pylint 'unidiomatic-typecheck' warnings.
Date: Thu, 04 Apr 2024 01:15:20 +0200

Hi Collin,

> I'm trying to fix some easy things to make warnings more meaningful.
> Here is two patches for that.
> 
> The first adds an option to the pylintrc configuration file. Right now
> the pylint output gets spammed with 'unidiomatic-typecheck' warnings.
> This is because we use:
> 
>      if type(var) is str:
> 
> instead of:
> 
>     if isinstance(var, str):
> 
> I think we discussed this previously and concluded it wasn't
> important. The warning spam is more likely to cause problems than the
> difference between these two conditions, in my opinion.

Yup. Thanks for dealing with this in the proper way.

> The second just removes the explicit inheritance from 'object' from
> our class declarations. Pylint warns about this, but it also feels
> like more "standard" Python 3 to me. The implicit object inheritance
> was added over 20 years ago, so I don't see any issues with it [1].

Indeed, the simple examples in the Python 3 tutorial
<https://docs.python.org/3/tutorial/classes.html>
omit "(object)".

Thanks. Applied.

Bruno






reply via email to

[Prev in Thread] Current Thread [Next in Thread]