-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
AstroidRelated to astroidRelated to astroidFalse Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codeWork in progressinference
Description
This is a weird interaction between the typing library and pylint, so I'm not sure if this is the right place to file the bug, but here goes.
Steps to reproduce
from typing import NewType
class A:
def __init__(self, value: int):
self.value = value
a = A(5)
a.value # no no-member error
B = NewType("B", A)
b = B(a)
b.value # Instance of 'B' has no 'value' memberpylint(no-member)
Current behavior
Pylint flags a no-member error when accessing members of objects with a NewType class.
Expected behavior
Pylint flags no errors.
pylint --version output
pylint 2.4.2
astroid 2.3.1
Python 3.7.4 (default, Sep 20 2019, 11:46:08)
[GCC 8.3.0]
CAM-Gerlach, earonesty and x4d3
Metadata
Metadata
Assignees
Labels
AstroidRelated to astroidRelated to astroidFalse Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codeWork in progressinference