Python 3.5 Typing ABCMeta does not define '__g

2019-05-04 07:36发布

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

1条回答
Summer. ? 凉城
2楼-- · 2019-05-04 07:46

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

查看更多
登录 后发表回答