Skip to content
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

Update Typeinfo for extensions in Response class #2840

Merged
merged 2 commits into from
Sep 7, 2023
Merged

Update Typeinfo for extensions in Response class #2840

merged 2 commits into from
Sep 7, 2023

Conversation

KalleDK
Copy link
Contributor

@KalleDK KalleDK commented Sep 2, 2023

To remove the unknown dict type info

(variable) extensions: ResponseExtensions | dict[Unknown, Unknown]

Summary

Simple add typing information for the extensions variable, as the default dict is "unknown"

Checklist

  • I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.

To remove the unknown dict type info

(variable) extensions: ResponseExtensions | dict[Unknown, Unknown]
@KalleDK KalleDK changed the title Update _models.py Update Typeinfo for extensions in Response class Sep 2, 2023
@tomchristie
Copy link
Member

I don't have a problem with merging this, since yep the typing here is correct.

(variable) extensions: ResponseExtensions | dict[Unknown, Unknown]

What tooling are you using that's showing you this type error? (We don't have a mypy issue here in our CI)

@tomchristie tomchristie merged commit e874351 into encode:master Sep 7, 2023
@KalleDK
Copy link
Contributor Author

KalleDK commented Sep 7, 2023

I don't have a problem with merging this, since yep the typing here is correct.

(variable) extensions: ResponseExtensions | dict[Unknown, Unknown]

What tooling are you using that's showing you this type error? (We don't have a mypy issue here in our CI)

Pylance (Pyright) with strict mode. They really don't like empty dicts/lists without typeinfo

@KalleDK KalleDK deleted the patch-1 branch September 7, 2023 14:11
@KalleDK
Copy link
Contributor Author

KalleDK commented Sep 7, 2023

And thanks for merging it - one squiggly line less and one type ignore less for me :)

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