-
-
Notifications
You must be signed in to change notification settings - Fork 122
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
[3.15] Add __class_getitem__
of classes
#582
Conversation
rest_framework-stubs/response.pyi
Outdated
@@ -22,6 +23,7 @@ class Response(SimpleTemplateResponse): | |||
exception: bool = ..., | |||
content_type: str | None = ..., | |||
) -> None: ... | |||
def __class_getitem__(cls, *args: Incomplete, **kwargs: Incomplete) -> Incomplete: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, provide correct types, Incomplete
is not a good solution :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for letting me know the shortcomings! Is it okay to change only the response
part for that type, or should I revise the other parts as well?
Please, provide correct types,
Incomplete
is not a good solution :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All places, please :)
Here are examples: https://github.com/search?q=repo%3Apython%2Ftypeshed%20__class_getitem__&type=code
Oh... I sincerely appreciate you providing an example!! |
I have made things!
I added
__class_getitem__
of classes in DRF version 3.15.The following are class items with
__class_getitem__
added.fields.Field.__class_getitem__
generics.GenericAPIView.__class_getitem__
request.Request.__class_getitem__
response.Response.__class_getitem__
Related issues
Upstream PR: encode/django-rest-framework#8825