-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Complete ttkthemes
#13858
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
base: main
Are you sure you want to change the base?
Complete ttkthemes
#13858
Conversation
This comment has been minimized.
This comment has been minimized.
stubs/ttkthemes/ttkthemes/_utils.pyi
Outdated
def get_temp_directory(): ... | ||
def get_themes_directory(theme_name: Incomplete | None = None, png: bool = False): ... | ||
def create_directory(directory): ... | ||
def temporary_chdir(new_dir: FileDescriptorOrPath) -> None: ... |
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.
This actually returns a ContextManager
, because it is decorated with @contextmanager
.
That said, I think we should delete _imgops.pyi
and _utils.pyi
from typeshed. They are not intended to be imported by users of this library.
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.
choosing between AbstractContextManager[None]
and Generator[None]
I took the latter (P.S.: ContextManager
from typing
is deprecated)
I don't think the types for these functions will get in the way for our type stubs, and many 3rd party libs have types for utils functions
I suggest leaving them
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.
Generator[None]
is wrong because that's not what the function returns when called.
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.
sorry, changed to AbstractContextManager[None]
.
it was a suggestion from my lsp server :)
@@ -21,10 +21,56 @@ class ThemedTk(tkinter.Tk, ThemedWidget): | |||
background: bool | None = ..., # old alias for themebg | |||
gif_override: bool = ..., | |||
) -> None: ... | |||
def set_theme(self, theme_name, toplevel: bool | None = None, themebg: bool | None = None) -> None: ... | |||
def set_theme(self, theme_name: str, toplevel: bool | None = None, themebg: bool | None = None) -> None: ... | |||
# TODO: currently no good way to say "use the same big list of kwargs as parent class but also add these" |
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.
Maybe this comment should be replaced with something like "Please keep this in sync with tkinter.Tk"? You should also add corresponding comment to stubs of tkinter.Tk
in stdlib, so that if one is changed, the other is changed as well. Otherwise these may get out of sync over time (although tkinter stubs are quite stable now).
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
I removed
kwargs
as a parameter for some methods since all the parameters used were already listed