[Python-ideas] Stub class for Generic to further improve PEP 560
kulakov.ilya at gmail.com
Thu Nov 30 16:08:04 EST 2017
As explained in PEP 560, creation of Generic subclasses is much slower (~7x on my machine).
My guess is that a limited number of applications actually need Generic classes at "production" runtime (i.e. when not under analysis of mypy or IDE).
I propose a special class that will alias typing.Generic whenever typing.TYPE_CHECKING == True and a no-op stub otherwise.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas