Skip to content

Changed APIView.headers to Dict[str, str] #114

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 1 commit into from
Dec 13, 2020

Conversation

MarcinWieczorek
Copy link
Contributor

closes #76

@MarcinWieczorek
Copy link
Contributor Author

That pop assigns None if Vary isn't in the dict and is used only for the if right below, therefore it doesn't count as None usage. I'm not aware of any other uses.

@MarcinWieczorek
Copy link
Contributor Author

I only found a similar case here: https://github.com/encode/django-rest-framework/blob/master/rest_framework/views.py#L456
None is used for flow control and is nullchecked before assignment. All other uses (as in grep -re headers) are either on strings constants or formatted strings as such: headers['Retry-After'] = '%d' % exc.wait

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Thanks!

@sobolevn sobolevn merged commit 535f67c into typeddjango:master Dec 13, 2020
@MarcinWieczorek MarcinWieczorek deleted the fix/apiview.headers branch December 13, 2020 11:08
@MarcinWieczorek
Copy link
Contributor Author

Great, thanks for quick response.
I'll use this moment to remind you of my PR in django-stubs that has been idling since March :)

@sobolevn
Copy link
Member

@MarcinWieczorek oh, sorry! I might have missed it. I will check it out right now.

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.

APIView.headers type is missing
2 participants