-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Python 3.12's
type
aliases
This adds support for the new syntactic type aliases added in Python 3.12. A few examples: ``` type NullableStr = str | None type Pair[T] = tuple[T, T] type NullableStrPair = Pair[NullableStr] ``` msgspec now supports these type aliases, *except* in cases where the type alias is recursive. For example, the following type isn't supported: ``` type Link[T] = tuple[T, Link[T] | None] ``` The internal datastructure we use to store type information was not designed to handle recursive types like these; supporting them will require a larger refactor.
- Loading branch information
Showing
6 changed files
with
258 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.