# Idea: Simpler and More Expressive Type Annotations

**URL:** <https://discuss.python.org/t/idea-simpler-and-more-expressive-type-annotations/104730>\
**Category:** Typing\
**Created:** [November 5, 2025, 12:24pm UTC](https://discuss.python.org/t/idea-simpler-and-more-expressive-type-annotations/104730 "2025-11-05T12:24:23Z")\
**Posts on this page:** 1\
**Showing post:** 44

<div class="post-metadata">

**Author:** ![Jelle](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/jelle/32/1049_2.png) [@Jelle](https://discuss.python.org/u/Jelle)\
**Post date:** [January 11, 2026, 10:56pm UTC](https://discuss.python.org/t/idea-simpler-and-more-expressive-type-annotations/104730/44 "2026-01-11T22:56:13Z")

</div>

> [@ImogenBits](#):
>
> we could also think about not using `ast.AST` objects directly in order to skip their construction and/or write the evaluating code in C

The Python-level AST objects are relatively expensive. Dino opened an issue about improving this ([Have internal immutable AST nodes · Issue #140514 · python/cpython · GitHub](https://github.com/python/cpython/issues/140514)) but not sure when or if that will land.

> [@ImogenBits](#):
>
> and/or write the evaluating code in C

It might make sense to have a separate third-party library that evaluates annotations in C (or Rust?) for speed, so we can keep the standard library implementation relatively simple but users like Pydantic that care about speed can use a faster version. Such a library could also allow backporting new syntax to earlier versions of CPython.

> [@ImogenBits](#):
>
> On the topic of memory usage, I suspect that the impact will be reasonably small. The AST is stored as tuples which almost exclusively contain statically allocated strings and integers, so it really shouldn’t be more than a handful of pointers per annotation.

I wouldn’t be so sure. Memory usage was a major motivation for PEP 563 and 649: people were noticing significant memory usage from typing objects, and those weren’t huge either.

---

_[View the full topic](https://discuss.python.org/t/idea-simpler-and-more-expressive-type-annotations/104730)._
