class Employee(NamedTuple):
name: str
id: int
E0239: Inheriting 'NamedTuple', which is not a class. (inherit-non-class)
no error
$ pylint --version
pylint 2.6.0
astroid 2.4.2
Python 3.9.0rc2+ (heads/3.9:d571924, Oct 5 2020, 11:56:25)
[Clang 9.0.0 (clang-900.0.39.2)]
@belm0 thanks for the report. I can reproduce it (i need to import NamedTuple from typing module). It seems to be specific to python 3.9 as there is not such error with python 3.8.
yes, is should be labeled with "regression" if possible
@belm0 this is not a pylint regression because the pylint behavior has not changed. It is "just" an adaptation to python 3.9 that need to be handled.
Seems to be same as https://github.com/PyCQA/pylint/issues/3884. This was raised upstream : https://bugs.python.org/issue41973
@tirkarthi thanks for your comment. It is indeed the same issue as #3884. I keep this issue open and close #3884.
I also receive the pylint warning: "R0903: Too few public methods (0/2) (too-few-public-methods)" on NamedTuples in python 3.9.0.
Am I right to assume that this unexpected warning is also part of this bug report?
@pjljvandelaar you are right. Both problem arise from the same reason. It is also linked to #3895 and should be addressed soon, once PyCQA/astroid#858 will be merged.
Most helpful comment
I also receive the pylint warning: "R0903: Too few public methods (0/2) (too-few-public-methods)" on NamedTuples in python 3.9.0.
Am I right to assume that this unexpected warning is also part of this bug report?