Skip to content

Conversation

@MarcellPerger1
Copy link
Contributor

Fixed incomplete tkinter.commondialog stub.

@github-actions

This comment has been minimized.

def __init__(self, master=None, **options) -> None: ...
def show(self, **options): ...
master: Misc | None
options: Mapping[str, Any]
Copy link
Collaborator

Choose a reason for hiding this comment

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

We now recommend adding a comment for each use of Any. For example:

Suggested change
options: Mapping[str, Any]
# Types of options are very dynamic. They depend on the command and are
# sometimes changed to a different type.
options: Mapping[str, Any]

IMO adding just one comment like this is enough for the whole file, since all Any uses are for things named options.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We now recommend adding a comment for each use of Any

Separate issue, but it might be worth mentioning this in the CONTRIBUTING.md file or somewhere more visible (or is there already some place with a collection of recommendations like this that I'm just missing?)

Copy link
Collaborator

@brianschubert brianschubert Jun 26, 2025

Choose a reason for hiding this comment

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

it might be worth mentioning this in the CONTRIBUTING.md file

Hmm, there was a mention, but it was removed as part of #13332. It might make sense to re-add it and perhaps other parts that were more about typeshed policy than style

Co-authored-by: Akuli <akuviljanen17@gmail.com>
@github-actions
Copy link
Contributor

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

@Akuli Akuli merged commit 47cfbee into python:main Jun 26, 2025
64 checks passed
# sometimes changed to a different type.
options: Mapping[str, Any]
def __init__(self, master: Misc | None = None, **options: Any) -> None: ...
def show(self, **options: Any): ...
Copy link
Contributor

@gameroman gameroman Jun 28, 2025

Choose a reason for hiding this comment

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

Should the return type of show also be Any or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I think the return type should be Any. Currently, it is implicitly Any (as it has no return type annotations) but it would probably be better to make is explicit.
(I just forgot to update the return type to Any)

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.

4 participants