-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
ContextVar[str] should return ContextVar class, not None #83160
Comments
The issue is minor, I suspect nobody wants to derive from ContextVar class. The generic implementation for __class_getitem__ is returning unmodified self argument. Yuri, is there a reason to behave differently in the case of ContextVar? If no, we can mark the issue as easy(C) and wait for a volunteer, the fix seems trivial. |
I don't think that's allowed, actually.
No, just an oversight, probably. |
I'd be happy to work on this! |
@asvetlov I have a question! Should "contextvar_cls_getitem" function be changed? And can you please help me figure out how to change it? |
I think it should look like the corresponding function from multidict: https://github.com/aio-libs/multidict/blob/master/multidict/_multidict.c#L803-L808 Please note, the method definition also should be updated, see https://github.com/aio-libs/multidict/blob/master/multidict/_multidict.c#L923-L928 for inspiration. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: