[Python-ideas] Lessons from typing hinting Whoosh (PEP484)

Guido van Rossum guido at python.org
Mon Nov 16 21:51:38 EST 2015


#1: typing.re defines the re types. For the others, the typeshed
project takes contributions.

#2: You can use def f() -> type: ... to specify a class as return
type; but we currently don't have a way to contrain that class.

On Mon, Nov 16, 2015 at 6:41 PM, Matt Chaput <matt at whoosh.ca> wrote:
> I forgot to say, there's been a couple of places where I haven't been able to add hinting that hopefully can be improved:
>
> 1. Standard library types that should be public but aren't (regular expression object)
> 2. Specifying an argument/return that's a class (that should be a subclass of some class).
>
> There might be a way to do 2 that I don't know about :)
>
> Cheers,
>
> Matt
>
> _______________________________________________
> 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/



-- 
--Guido van Rossum (python.org/~guido)


More information about the Python-ideas mailing list