Skip to content

Conversation

@roberfi
Copy link
Contributor

@roberfi roberfi commented Nov 22, 2025

Added TopResult as the return type for Container.top() and ContainerApiMixin.top() instead the incorrect str.

Docstring in docker/docker-py#3371 is also fixed.

Fixes docker/docker-py#2958

@github-actions

This comment has been minimized.

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, one comment below.

) -> None: ...

@type_check_only
class TopResult(TypedDict):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typecheck-only types need to be prefixed with _ to make it clear to users that this is "special" in some way, even if their IDE or editor doesn't point out the fact that it can't be imported at runtime.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes! You are right. I'll fix it now

@github-actions
Copy link
Contributor

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

@srittau srittau merged commit c10e368 into python:main Nov 24, 2025
48 checks passed
@roberfi roberfi deleted the fix-docker-container-top-return-type branch November 25, 2025 14:00
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.

Incorrect documented return type for Container.top()

2 participants