[docker-py] Add some return types to DockerClient method
#15069
Merged
+24
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've used info from
stubs/docker/docker/api/daemon.pyito annotate the following methods:df,events,info,login,pingandversion.Besides, to add the Generic type for
eventsmethod, I've checked the behavior of that method inhttps://github.com/docker/docker-py/blob/62bd22d9b7581157e118e5bc69f391f3331b3c6d/docker/api/daemon.py#L24, where
_stream_helpertakesdecodeargument to returntextorjson()from response.On the other hand, the method
closecomes fromrequests.Sessionand returns None :https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/src/requests/sessions.py#L794