-
Notifications
You must be signed in to change notification settings - Fork 125
Closed
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
The type annotation for container.run() here is Union[Container, Union[Generator[str, None, None], Iterator[str]]].
The docstring for the return type states:
Returns:
- When detach is True, return a Container
- If stdout is True, include stdout from container in output
- If stderr is True, include stderr from container in output
- When stream is True, output from container is returned as a generator
- Otherwise, an iterator is returned after container has finishedSo, when stream is True, according to the return type, one would expect Generator[str, None, None] as the return type. In fact, what is returned is [Generator[bytes, None, None]. I am not sure if this is a bug in the type annotation, or incorrect implementation, and decoding to a string is actually expected.
In addition, those conditional return types really should be encoded as a set of overlad annotations for that method - the current type hint is pretty useless as is.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers