-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
docker: fix unrequired kwargs to have a default value #14666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
brianschubert
merged 3 commits into
python:main
from
lev-blit:bugfix/docker-required-literals
Sep 6, 2025
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The two
run
overloads still overlap (only one should have a default value fordetach
), and I'm not sure why they've been reversed. I think these were working as expected and you can revert therun
changes, or is there an issue I'm not seeing?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the default seems to be
False
, that's why I reversed them (to have the common one be the bottom one)regarding the overlap - if I change the top one from
Literal[True] = True
toLiteral[True]
then mypy (the one configured for my vscode setup) says that "Overloaded function signatures 1 and 2 overlap with incompatible return types"...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These still overlap when using
Literal[True] = True
(I'm not sure why mypy doesn't emit an error in that case. That might be a bug or the result of a tradeoff that permits some kinds of useful overlaps. See python/mypy#19803)I'm unclear on what problem is being solved here. Could you clarify what the issue with the current
run
signature is?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
honestly, I'm not sure this needs changing... lol
I don't need it for sure, will remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to make sure I do the right thing - I want to add an overload for
create
which hasdetach: Literal[True]
and returnsContainer
, and the defaultdetach: bool = False
will returnbytes
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does
create
need overloads? The docs seem to indicate that it returnsContainer
unconditionally: https://github.com/docker/docker-py/blob/6e6a273573fe77f00776b30de0685162a102e43f/docker/models/containers.py#L921-L922There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are... correct :) thank you!