Skip to content

False positive E1136: Value 'typing.ChainMap' is unsubscriptable (unsubscriptable-object) #2849

@jhbuhrman

Description

@jhbuhrman

Steps to reproduce

  1. Create the following file named pylint_chainmap.py:
import typing
from collections import ChainMap


def check_pylint_chain_map() -> typing.ChainMap[str, typing.Any]:
    return ChainMap({"answer": 42})
  1. pylint --reports=n --score=n --disable=C0111 pylint_chainmap.py

Please note that mypy is perfectly happy with this source file.

Current behavior

************* Module pylint_chainmap
pylint_chainmap.py:5:32: E1136: Value 'typing.ChainMap' is unsubscriptable (unsubscriptable-object)

Expected behavior

pylint --version output

pylint 2.3.1
astroid 2.2.5
Python 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 03:37:03) [MSC v.1900 64 bit (AMD64)]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions