-
- Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
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 codeinference
Milestone
Description
Bug description
The following code results in a false positive. (The type hints may be removed; however, the cast and dummy assignment may not).
"""Docstring.""" from typing import TypeVar from typing import cast T = TypeVar('T') def ident(thing: T) -> T: """Return thing.""" return cast(T, thing) _ = ident([]) dict(**ident({}))Configuration
No response
Command used
pylint bug.pyPylint output
************* Module bug bug.py:15:7: E1134: Non-mapping value ident({}) is used in a mapping context (not-a-mapping)Expected behavior
No error should be produced.
Pylint version
pylint 2.15.10 astroid 2.13.2 Python 3.10.9 (main, Dec 15 2022, 18:25:35) [Clang 14.0.0 (clang-1400.0.29.202)]OS / Environment
macOS 13
Additional dependencies
No response
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 codeinference