Skip to content

Add challenge for variadic generics #76

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

Merged
merged 4 commits into from
Dec 23, 2023

Conversation

daya0576
Copy link
Contributor

Add a new challenge for variadic generics for #60

Reference:

  1. https://peps.python.org/pep-0646/
  2. https://www.youtube.com/watch?v=hAj3nGzeSiQ

@laike9m
Copy link
Owner

laike9m commented Dec 17, 2023

Thanks for contributing this new challenge!

I see a few things that can be improved, for example, the code is missing ## End of your code ##, as described in:
https://github.com/laike9m/Python-Type-Challenges/blob/main/docs/Contribute.md#how-to-add-a-new-challange

Also, is it possible to remove the following code from question.py, as it seems to be part of the solution? Or we can put it in hints.md

T = TypeVar("T")
Ts = TypeVarTuple("Ts")

S1: TypeAlias = Tuple[float, int]
S2: TypeAlias = Tuple[*S1, str]

@daya0576
Copy link
Contributor Author

Hi, thank you for your suggestions!

I have removed the code from question.py, but is it ok if the question code cannot run?

@laike9m
Copy link
Owner

laike9m commented Dec 18, 2023

Hi, thank you for your suggestions!

I have removed the code from question.py, but is it ok if the question code cannot run?

It's fine as long as it's valid Python code. We don't actually run the code after all.

@laike9m
Copy link
Owner

laike9m commented Dec 18, 2023

Could you also add a solution2.py using Python 3.12's new generic syntax? Thanks.

@daya0576
Copy link
Contributor Author

Could you also add a solution2.py using Python 3.12's new generic syntax? Thanks.

Hi, I have added the solution2.py using the latest generic syntax. 🎄🎄🎄

@laike9m
Copy link
Owner

laike9m commented Dec 23, 2023

Thanks!

@laike9m laike9m merged commit 95fef31 into laike9m:main Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants