Is there a python IDE that will indicate the type of a variable when hovering over it?

Sometimes I write projects and do not return to them until several months. Unfortunately, for me, I forgot what was intended to pass the function. I would like to be able to hover over the argument and see a type such as integer, string, some class, etc. Is there an IDE that will do this for me? Any help is appreciated.

+3
source share
3 answers

It is not possible to infer a type normally, so no IDE can do this. Why not just use docstrings?

def foo(a, b):
    """
    Take your arguments back, I don't want them!

    a -- int
    b -- str
    """

    return a, b

In Python 3, you can also use function annotations:

def foo(a: int, b: str):
    """Take your arguments back, I don't want them!"""

    return a, b
+8
source

Python , . Python , .

, any True, . bool to bool? . , , , . , , , , , , . , , , any -, . python ( ) true/false , bools.

"" Python, , . , , . IDE, , , .

, , / . , , .

+2

PyCharm CTRL , . PyCharm , python3.

0

All Articles