+ 2

Statically typed Python - MyPy.

MyPy is an optional static type checker for Python. You can add type hints (PEP 484) to your Python programs, and use mypy to type check them statically. Find bugs in your programs without even running them! You can mix dynamic and static typing in your programs. You can always fall back to dynamic typing when static typing is not convenient, such as for legacy code. Here is a small example to whet your appetite (Python 3): ---------------------------------------------------- from typing import Iterator def fib(n: int) -> Iterator[int]: a, b = 0, 1 while a < n: yield a a, b = b, a + b ---------------------------------------------------- https://github.com/gvanrossum/mypy

30th Jun 2018, 8:20 AM
Alihuseyn Kengerli
Alihuseyn Kengerli - avatar
1 Resposta
+ 1
thanks for sharing
30th Jun 2018, 4:53 PM
$¢𝐎₹𝔭!𝐨𝓝
$¢𝐎₹𝔭!𝐨𝓝 - avatar