In any Python 3.6 or later, type

    >>> x : float = 1
    >>> isinstance(x, float)

or replace the second line with

    >>> type(x)

As someone who has programmed in FORTRAN, Pascal, C/C++,
Java, and Go this is not at all what I consider reasonable. I do not
believe other programmers with experience in typed languages
would expect this behaviour either.

Having a type checker run before the Python interpreter in our
current day continuous build/integration environment adds a
second step and therefore the chance for it to be forgotten, for
version mismatches, for warning/error reports to be misdirected.
>From an environmental point of view we're also doing the read
source, lexical scan, syntax parse twice rather than once.

If typing is the future of Python, and the number of PEPs being
worked on suggests that it is, then type checking should be
integrated into CPython itself.

An alternative is the TypeScript/JavaScript model, where typed
Python becomes a distinct programming language that cannot
be executed directly by the Python interpreter.

-- 

        cheers,
        Hugh Fisher
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/273J3AZ7VY7HRPDMGDHDCDELE3JV7WPT/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to