Repository navigation
Wire in typing_extensions and set Message generic parameter default - #79
Merged
Merged
Conversation
ajeetdsouza
approved these changes
Aug 27, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We initially were able to remove
typing_extensionssince we only used it forassert_neverwhich is easy to backport, but I always expected we would need it eventually. The use case now came up for using Python 3.13 (many years until being baseline version)defaulttypevar (bufbuild/protovalidate-py#522) which isn't easy to backport. It should be possible for a library to support protobuf-py by declaringMessagewithout a type parameter as their argument since they don't generally need to deal with field names, or possible other supporting types we may add. Currently it's not possible for any widely used library since strict type checkers reject it, and we don't want users to have to ignore type checkers in their code.I have reframed "zero dependencies" as "zero third-party dependencies" because
typing_extensionsis cpython's official backport library and extremely widely used and fully accepted by the ecosystem, there is no meaningful regression by adding it.