◐ Shell
clean mode source ↗

gh-124157: Lazily create __annotate__ functions for function annotations by JelleZijlstra · Pull Request #128362 · python/cpython

@larryhastings I recall you were working on a version of this, but I got impatient and spent a bit of time on it this morning. This only covers annotations on functions, partly because I'm lazy and partly because those are by far the most common anyway. However, I ran some benchmarks and it's not clear to me this makes much of a dent on memory usage anyway; function objects aren't that big.