Skip to content

Conversation

@roberfi
Copy link
Contributor

@roberfi roberfi commented Dec 1, 2025

This new overload is needed for a wrapping function like:

def my_function(
    obj: ExecApiMixin,
    exec_id: str,
    detach: bool = False,
    tty: bool = False,
    stream: bool = False,
    socket: bool = False,
    demux: bool = False,
) -> None:
    obj.exec_start(exec_id, detach, tty, stream, socket, demux)

If this new overload is not present, mypy will give the following error:

No overload variant of "exec_start" of "ExecApiMixin" matches argument types "str", "bool", "bool", "bool", "bool", "bool"

Besides, return type when stream=True (False for the rest) is CancellableStream[bytes] instead of CancellableStream[str] and bytes instead of str if everything is False.

@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@roberfi roberfi force-pushed the add-exec_start-overload branch from f3fcdc3 to 0cb8099 Compare December 1, 2025 08:44
@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2025

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@srittau srittau merged commit 61f2be3 into python:main Dec 1, 2025
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants