[Python-ideas] Moving typing out of the stdlib in Python 3.7?

Guido van Rossum guido at python.org
Fri Nov 3 10:49:13 EDT 2017


On Fri, Nov 3, 2017 at 7:45 AM, Chris Angelico <rosuav at gmail.com> wrote:

> On Sat, Nov 4, 2017 at 1:35 AM, Guido van Rossum <guido at python.org> wrote:
> > [A copy from https://github.com/python/typing/issues/495 to get more
> > people's attention to this issue.]
> >
> > I'm wondering if we should remove typing from the stdlib. Now's the time
> to
> > think about this, as the feature freeze for 3.7 is about 12 weeks away.
> >
> > Cons:
> >
> > People have to depend on a PyPI package to use typing (but they do anyway
> > for typing_extensions)
>
> If the lazy evaluation of annotations (PEP 563) also lands in 3.7,
> then this would be a very minor downside. You'd need to pip-install
> typing as well as mypy *for the actual type checking*, but at run
> time, you could ignore both (all those List[...] annotations would be
> stored unevaluated). Otherwise, it'd mean that any project that makes
> use of type hints would require typing as a run-time dependency.
>

This would not work if you use TypeVar, NewType, or any kind of type alias
involving things imported from typing (e.g. Union or TypedDict). Also
cast().

-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20171103/866f3dbf/attachment.html>


More information about the Python-ideas mailing list