Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ-IDEA's Python type checker - incorrect expected type?

In the following code:

from typing import List
def test() -> List[str]:
    ret = ["Hi", "Hi"]
    return ret

I'm receiving the following warning on the function definition line:

Expected type 'Integral", got 'str' instead

I can't see any reason why IntelliJ-IDEA's python module would interpret this simple function as returning an list of Integral rather than str. Is this a type checker bug?

like image 995
Shookit Avatar asked Apr 28 '15 15:04

Shookit


1 Answers

Pycharm only have some preliminary support for type hints.

like image 70
robermorales Avatar answered Oct 24 '22 12:10

robermorales