Skip to content

Commit

Permalink
Use @overload on Docker logs method to show different return types
Browse files Browse the repository at this point in the history
  • Loading branch information
adamtheturtle committed May 11, 2024
1 parent 96dbb34 commit f4a54f6
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions stubs/docker/docker/api/container.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from _typeshed import Incomplete
from typing import Literal, overload

from docker.types.daemon import CancellableStream

Expand Down Expand Up @@ -68,18 +69,33 @@ class ContainerApiMixin:
def get_archive(self, container, path, chunk_size=2097152, encode_stream: bool = False): ...
def inspect_container(self, container): ...
def kill(self, container, signal: Incomplete | None = None) -> None: ...
@overload
def logs(
self,
container,
stdout: bool = True,
stderr: bool = True,
stream: bool = False,
stream: Literal[False] = False,
timestamps: bool = False,
tail: str = "all",
since: Incomplete | None = None,
follow: Incomplete | None = None,
until: Incomplete | None = None,
) -> CancellableStream | bytes: ...
) -> bytes: ...
@overload
def logs(
self,
container,
stdout: bool = True,
stderr: bool = True,
*,
stream: Literal[True],
timestamps: bool = False,
tail: str = "all",
since: Incomplete | None = None,
follow: Incomplete | None = None,
until: Incomplete | None = None,
) -> CancellableStream: ...
def pause(self, container) -> None: ...
def port(self, container, private_port): ...
def put_archive(self, container, path, data): ...
Expand Down

0 comments on commit f4a54f6

Please sign in to comment.