Search code examples
pythonpycharmpython-typing

Python 3.5 Typing ABCMeta does not define '__getitem__'


I am trying out Python 3.5's typing module by marking up a few of my functions.

I have a function that returns a list though I am getting a warning in PyCharm.

The warning reads:

Class 'ABCMeta' does not define '_getitem_', so the '[]' operator cannot be used on its instances

from typing import List

def get_list() -> List[int]:
    return [1, 2, 3]

Is anyone able to better interpret that message then I can?

Thanks


Solution

  • Was a bug in PyCharm. Resolved in 5.0.3. REF: https://youtrack.jetbrains.com/issueMobile/PY-17841