UNy2018-01-28 23:48:35
UNy, 2018-01-28 23:48:35

Annotations in python?

Why do we need annotations in functions? There is an example:

def f(a:'spam', b:(1,10), c: float) -> int:
    return a+b+c

f(5,6,7) - #вернет конечно же 18
What is the point then in the annotations themselves if they do nothing?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Kirill Romanov, 2018-01-28

For the IDE and other people who will read the code

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question