Skip to content
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

Update tkinter.Misc for 3.13 #12367

Merged
merged 13 commits into from
Dec 28, 2024
Merged

Conversation

max-muoto
Copy link
Contributor

@max-muoto max-muoto commented Jul 20, 2024

Add new methods on tkinter.Misc for 3.13.

@max-muoto max-muoto changed the title Update tkiner.Misc for 3.13 Update tkinter.Misc for 3.13 Jul 20, 2024
@max-muoto max-muoto marked this pull request as ready for review July 20, 2024 04:07
@max-muoto
Copy link
Contributor Author

CC: @Akuli

This comment has been minimized.

# Supports options from `_BusyInfo``
def tk_busy_cget(self, option: Literal["cursor"]) -> _Cursor: ...
busy_cget = tk_busy_cget
def tk_busy_configure(self, cnf: Any = None, **kw: Any) -> Any: ...
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can overload this similarly to other configure methods to get rid of **kw: Any. Look at Tk.configure for a relatively simple example.

After writing the types for those other configure methods, I have realized that there are better ways to do it, but that's beyond the scope of this PR and it's fine to go with the existing pattern. By far the most common use case is passing keyword arguments and ignoring the return value, e.g. widget.busy_config(cursor="hand2") in this case.

Co-authored-by: Akuli <akuviljanen17@gmail.com>

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

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

@JelleZijlstra JelleZijlstra merged commit 92231a5 into python:main Dec 28, 2024
63 checks passed
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.

3 participants