Skip to content

from __future__ import annotations doesn't ignore annotations correctly #3236

Closed
@Starwort

Description

@Starwort

Steps to reproduce

  1. Use code
from __future__ import annotations
from collections import defaultdict
squares: defaultdict[tuple, int] = defaultdict(lambda: 999999)
  1. Run pylint on this code
  2. E1136: Value 'defaultdict' is unsubscriptable (unsubscriptable-object)

Current behaviour

Throws E1136: Value 'defaultdict' is unsubscriptable (unsubscriptable-object)

Expected behaviour

Ignores it (as Python itself does)

pylint --version output

pylint 2.4.3
astroid 2.3.1
Python 3.8.0 (default, Oct 15 2019, 14:05:58) 
[GCC 7.4.0]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions