3 ms·
No he means CPython. While the meaning of the annotations are ignored at runtime, the typing library still has to be imported and typing annotations evaluated (
by icegreentea2 8y ago
No he means CPython. While the meaning of the annotations are ignored at runtime, the typing library still has to be imported and typing annotations evaluated (as it evaluate that the type annotation has a value of List[int], not to check that the value tagged with the type annotation actually has that value).
As a result, in CPython 3.6 a module that has been type hinted will import slower than one that doesn't.
- xapata 8y ago> Python supersets that do use type annotations for optimization Such as Cython.