Skip to content

Wrong typing for Exception.detail #56

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

Closed
AlwxSin opened this issue Dec 23, 2019 · 5 comments · Fixed by #57
Closed

Wrong typing for Exception.detail #56

AlwxSin opened this issue Dec 23, 2019 · 5 comments · Fixed by #57

Comments

@AlwxSin
Copy link
Contributor

AlwxSin commented Dec 23, 2019

For now type of APIException.detail is _Detail = Union[str, Dict[str, Any]]. But it also could be a list.

A possible solution is to set _Detail = Union[str, List[Any], Dict[str, Any]]. Would you mind if I make a PR?

@sobolevn
Copy link
Member

List[Any]? Can we narrow this type a bit?

@AlwxSin
Copy link
Contributor Author

AlwxSin commented Dec 24, 2019

I'd like too but don't know how to do it. And there is already Dict[str, Any]

AlwxSin added a commit to AlwxSin/djangorestframework-stubs that referenced this issue Dec 26, 2019
sobolevn pushed a commit that referenced this issue Dec 26, 2019
@apragacz
Copy link

@sobolevn Was that change released? It doesn't look like so - the last version (1.1.0) was released few weeks earlier... any chance for this change to be released soon?

@sobolevn
Copy link
Member

Yes, I can make a release this week. Currently you can try master branch to see if that works for you. Any issues and bugs are welcome!

@apragacz
Copy link

@sobolevn Thanks for you answer!

I suppose I will wait for the official release and remove type: ignore comments in my code later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants