Open JonathanRohland-TNG opened 2 years ago
Thanks for the report. We could probably close all of the NewType
issues as duplicates of #2296. We need astroid
to know that NewType callables return instances of the parameter passed in.
Current NewType
bugs afaik : #2296, #3162, #4944, #4961
Bug description
When using a NewType type definition based on
Dict[str,str]
and using regular dict-access methods, this generates various false positive warnings, e.g.unsupported-assignment-operation
,unsubscriptable-object
.Sample code:
Possibly related issues: For Tuples: https://github.com/PyCQA/pylint/issues/4944 For Lists: https://github.com/PyCQA/pylint/issues/2296
Configuration
No response
Command used
Pylint output
Expected behavior
No issues should be reported, as the dict-access is correct.
Pylint version
OS / Environment
MacOS on M1 Mac (arm64-architecture)
Additional dependencies
No response