Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] PEP 646 implementation #963

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
Draft

Conversation

@JelleZijlstra
Copy link
Member

@JelleZijlstra JelleZijlstra commented Nov 24, 2021

Fixes #950.

This turned out to require even more hacks than usual, because the runtime in old versions of typing really doesn't want things that are not TypeVars to be used as TypeVars.

The tests were copied from https://github.com/python/cpython/pull/24527/files and the implementation is mostly inspired by Required/NotRequired (Unpack) and ParamSpec (TypeVarTuple).

I've only tried Python 3.9 locally so far.

TODOs include:

  • Make other Python versions work
  • More tests for things like get_origin() and get_args()
  • Write docstring for TypeVarTuple
@JelleZijlstra
Copy link
Member Author

@JelleZijlstra JelleZijlstra commented Dec 1, 2021

The last 3.6 failures are annoying and I don't see an easy fix, I think I'll give it another try tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants