-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix incomplete tkinter.commondialog
stub
#14340
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
from _typeshed import Incomplete | ||
from collections.abc import Mapping | ||
from typing import ClassVar | ||
from tkinter import Misc | ||
from typing import Any, ClassVar | ||
|
||
__all__ = ["Dialog"] | ||
|
||
class Dialog: | ||
command: ClassVar[str | None] | ||
master: Incomplete | None | ||
options: Mapping[str, Incomplete] | ||
def __init__(self, master=None, **options) -> None: ... | ||
def show(self, **options): ... | ||
master: Misc | None | ||
# Types of options are very dynamic. They depend on the command and are | ||
# 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): ... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the return type of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I think the return type should be |
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.
We now recommend adding a comment for each use of
Any
. For example:IMO adding just one comment like this is enough for the whole file, since all
Any
uses are for things namedoptions
.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.
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?)Uh oh!
There was an error while loading. Please reload this page.
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.
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