Explicitly typed version of Python?

I rather like Python syntactic sugar; and standard library functions.

However, one feature that I do not like; This is implicit typing.

Is there a Python distribution with an explicit character set; which is still compatible, for example, with PyPi packages?

[I looked in RPython]

+4
source share
4 answers

The short answer is no. What you are asking for is deeply embedded in Python and cannot be changed without changing the language so radically that it will not be Python.

, , ? , .

+3

. .

Python , ! . ( )

2 : 1) - 2)

1)

  • PyPi,
  • ctype libs .

, 10% , . 90%? .

2)

  • ( )

NOT FITTING , , . , .

, , , - ( , )

, , (, , ).

... Sublime Text . , .

(, , . , , )

+2

python 3 python PEP 3017. Fast-forward python 3.5 PEP 0484 , typing, .

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://pawelmhm.imtqy.com

484 :

__annotations__, . . , linter. , JIT , .)

, python " ", , .. , python , , . , , , , .

python mypy, , , . examples, .

+2

...

Python . , , , , , , .

, RPython , - . , Python , , .

, .

-1

Source: https://habr.com/ru/post/1531507/


All Articles