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

Wrong return type annotathion for json of WSMessage in http_websocket.py #3707

Closed
olned opened this issue Apr 20, 2019 · 1 comment
Closed
Labels

Comments

@olned
Copy link

olned commented Apr 20, 2019

The json method of the WSMessage class returns parsed JSON data but declared as return None.

aio-libs/aiohttp/http_websocket.py

Line 86

85    def json(self, *,  # type: ignore
86             loads: Callable[[Any], Any]=json.loads) -> None:
87        """Return parsed JSON data.
88        .. versionadded:: 0.22
89        """
90        return loads(self.data)

May be it would be better if it return type was absent?

@asvetlov asvetlov added bug good first issue Good for newcomers labels Apr 25, 2019
@asvetlov
Copy link
Member

Yes, it is an error.
Return type should be Any.

@asvetlov asvetlov closed this as completed May 6, 2019
@lock lock bot added the outdated label May 5, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants