Documentation of ping() is not clear
codebude opened this issue · 1 comments
The issue refers to: https://redis-py.readthedocs.io/en/stable/commands.html#redis.commands.core.CoreCommands.ping
The documentation of the ping() method is unclear or confusing. According to the documentation, the return value is:
Union[Awaitable, Any]In practice, however, the callback logic always returns a bool by default. See:
I suggest changing the return-type in the documentation to:
Union[Awaitable, bool]It would also be helpful if the mode of operation were also mentioned in the description. Because the current text only refers to the redis.io PING documentation, which says that the return value is a string with the value “PONG”:
Ping the Redis server
For more information see https://redis.io/commands/ping
I would suggest something like:
Ping the Redis server
Send
PING1 command to server and returns booleanTrueif the server's response equals "PONG"2.1For more information on the underlying ping command see https://redis.io/commands/ping
2This default behaviour can be overwritten by setting a custom callback.