[Python-ideas] Lessons from typing hinting Whoosh (PEP484)
Ryan Gonzalez
rymg19 at gmail.com
Mon Nov 16 22:36:22 EST 2015
On November 16, 2015 8:51:38 PM CST, Guido van Rossum <guido at python.org> wrote:
>#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.
>
What about a typing.Class or typing.Type generic? Like:
def f() -> Type[MyBaseClass]: ...
>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/
--
Sent from my Nexus 5 with K-9 Mail. Please excuse my brevity.
More information about the Python-ideas
mailing list