Skip to content

Commit

Permalink
Add return type to Docker Container.logs
Browse files Browse the repository at this point in the history
The documentation at
https://docker-py.readthedocs.io/en/stable/containers.html#docker.models.containers.Container.logs
says "generator or str", but docker/docker-py#2240
will change this to say "generator of bytes or bytes".
  • Loading branch information
adamtheturtle committed May 10, 2024
1 parent 9174db0 commit ef9f962
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion 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 collections.abc import Generator

class ContainerApiMixin:
def attach(
Expand Down Expand Up @@ -77,7 +78,7 @@ class ContainerApiMixin:
since: Incomplete | None = None,
follow: Incomplete | None = None,
until: Incomplete | None = None,
): ...
) -> Generator[bytes, None, None] | bytes: ...
def pause(self, container) -> None: ...
def port(self, container, private_port): ...
def put_archive(self, container, path, data): ...
Expand Down
3 changes: 2 additions & 1 deletion stubs/docker/docker/models/containers.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from _typeshed import Incomplete
from collections.abc import Generator
from typing import NamedTuple

from .resource import Collection, Model
Expand Down Expand Up @@ -39,7 +40,7 @@ class Container(Model):
def export(self, chunk_size=2097152): ...
def get_archive(self, path, chunk_size=2097152, encode_stream: bool = False): ...
def kill(self, signal: Incomplete | None = None): ...
def logs(self, **kwargs): ...
def logs(self, **kwargs) -> Generator[bytes, None, None] | bytes: ...
def pause(self): ...
def put_archive(self, path, data): ...
def remove(self, **kwargs) -> None: ...
Expand Down

0 comments on commit ef9f962

Please sign in to comment.