[Python-ideas] PEP 484 (Type Hints) -- first draft round

Chris Angelico rosuav at gmail.com
Thu Jan 22 13:37:33 CET 2015

On Thu, Jan 22, 2015 at 11:32 PM, Ed Kellett <edk141 at gmail.com> wrote:
> On Thu Jan 22 2015 at 12:17:37 Chris Angelico <rosuav at gmail.com> wrote:
>> The absence of a decorator that uses the annotations some other way
>> should make it clear that they're type hints, just as the absence of a
>> "global" statement should make it clear that assigned names are local
>> to a function.
> What about code that already exists? What about modules that want to support
> Python installations that already exist (hence don't have the `typing`
> module)? What about module authors who simply don't want to make their code
> ugly with a no-op decorator just to signify that they're not making it ugly
> with type annotations?

If you don't run the type checker, and the annotations will continue
to do what they always have done. Seems easy enough.

Supporting Python installations that already exist is as simple as
either installing a backported typing.py, or not using a feature that
didn't exist at that point. Same as the compatibility requirements of
using enumerations in earlier versions of Python - you either grab the
one off PyPI, or don't use 'em. I'm not seeing a problem here... have
I missed something?


More information about the Python-ideas mailing list