Skip to content

Add support for PEP 695 type aliases#14898

Draft
loewexy wants to merge 1 commit into
pyca:mainfrom
loewexy:asn1-add-support-for-pep695-type-aliases
Draft

Add support for PEP 695 type aliases#14898
loewexy wants to merge 1 commit into
pyca:mainfrom
loewexy:asn1-add-support-for-pep695-type-aliases

Conversation

@loewexy
Copy link
Copy Markdown
Contributor

@loewexy loewexy commented May 22, 2026

Fixes #14892

However, currently the implementation is missing tests for that specific feature.

@loewexy loewexy marked this pull request as draft May 22, 2026 12:16
@alex
Copy link
Copy Markdown
Member

alex commented May 22, 2026

@facutuesca do you have a) opinions on if this is the right place for this? b) thoughts on how to test?

@loewexy
Copy link
Copy Markdown
Contributor Author

loewexy commented May 22, 2026

I have to setup a complete development environment for cryptography to test so that i can also run the linters and stuff, however i will not manage to do this today. But I will try to do it next week. Otherwise also feel free to use my draft and update it as you like.

Comment on lines +111 to +112
if sys.version_info >= (3,12):
while isinstance(field_type, typing.TypeAliasType):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could also be present in previous versions by using typing_extensions.TypeAliasType. See the top of the file for how we handle conditionally importing from typing vs typing_extensions for different Python versions.

@facutuesca
Copy link
Copy Markdown
Contributor

facutuesca commented May 22, 2026

b) thoughts on how to test?

If the only concern about testing is the newer Python versions needed for the feature (mentioned here), see my review comment about supporting typing_extensions.TypeAliasType for older Python versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

asn1: Support type aliases

3 participants