[Python-ideas] Typecheckers: there can be only one

Ryan Gonzalez rymg19 at gmail.com
Wed Sep 7 09:50:10 EDT 2016


On Sep 7, 2016 4:28 AM, "Hugh Fisher" <hugo.fisher at gmail.com> wrote:
>
> There's been discussion here and on python-dev regarding PEP 526 that
> assumes there will be multiple type checkers for Python. I really
> can't see this happening.

It already did:

- mypy
- pytype
- PyCharm has an integrated one
- pylint will add support in the future

> If typing annotations become common or maybe
> considered best practice, the Zen of Python "there should be one-- and
> preferably only one --obvious way to do it" will take effect.
>
> Firstly, the interpreter will need to have type checking built in.

A lot of people would disagree.

> Just about every intro book and tutorial for Python says how great it
> is that you don't have an edit-save-compile cycle, just fire up the
> Python interpreter and start typing. Having to run a separate type
> checker will be considered as ridiculous as a C compiler that didn't
> run the preprocessor itself.
>

Remember: you don't have to run it. You can prototype to your hearts
content and then have it run as a commit hook. So you still have the nice,
tight cycle that you mentioned.

> Secondly, PyPI will collapse if there isn't just one.

Too late!

> How can we
> express dependencies between packages that use different type
> checkers?

Add the type checker to the dev dependencies; as long as it's PEP
484-compatible, the user couldn't care less.

> When type checkers themselves have versions?

CPython has versions.

> When a dev team
> uses one type checker for 1.x and then switches to another for 2.x?

That's the dev team's problem.

> That's a special circle of hell.
>
>
> --
>
>         cheers,
>         Hugh Fisher
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/

--
Ryan
[ERROR]: Your autotools build scripts are 200 lines longer than your
program. Something’s wrong.
http://kirbyfan64.github.io/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160907/ce60840b/attachment-0001.html>


More information about the Python-ideas mailing list