Skip to content

Conversation

intgr
Copy link
Contributor

@intgr intgr commented Jun 6, 2023

Fixes new errors that appeared after django-stubs changes.

drf_source/tests/test_response.py:259: note: "Dict" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
drf_source/tests/test_response.py:259: note: Consider using "Mapping" instead, which is covariant in the value type
drf_source/tests/test_response.py:269: note: "Dict" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
drf_source/tests/test_response.py:269: note: Consider using "Mapping" instead, which is covariant in the value type
drf_source/tests/test_response.py:278: note: "Dict" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
drf_source/tests/test_response.py:278: note: Consider using "Mapping" instead, which is covariant in the value type

Related issues

Probably caused by typeddjango/django-stubs#1529

@intgr intgr changed the title CI: Add suppressions due to django-stubs changes CI: Add typecheck suppressions due to django-stubs changes Jun 6, 2023
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.

I think that we can use Mapping there, the only method that is using headers is https://github.com/django/django/blob/4f6a51dfe6a4a8d5ed61c73b902e808109f142b0/django/http/request.py#L461

And it allows Mapping.

@intgr
Copy link
Contributor Author

intgr commented Jun 8, 2023

Fixed in typeddjango/django-stubs#1537 instead, closing.

@intgr intgr closed this Jun 8, 2023
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.

2 participants