Faster CPython at PyCon, part one
Faster CPython at PyCon, part one
Posted May 10, 2023 6:37 UTC (Wed) by tchernobog (guest, #73595)Parent article: Faster CPython at PyCon, part one
Does anybody know if specifying type annotations such as floats are able to skip the adaptive instructions and go to their specialized counterparts directly?
Posted May 10, 2023 6:43 UTC (Wed)
by dureuill (guest, #164965)
[Link]
Faster CPython at PyCon, part one
To my knowledge it doesn't: type annotations are not used at runtime. Plus, nothing at runtime prevents a user from calling such an annotated function with the wrong types anyway.