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

Add **kw to tkinter.Misc.after and tkinter.Misc.after_idle #126899

Closed
Xiaokang2022 opened this issue Nov 16, 2024 · 0 comments
Closed

Add **kw to tkinter.Misc.after and tkinter.Misc.after_idle #126899

Xiaokang2022 opened this issue Nov 16, 2024 · 0 comments
Labels
stdlib Python modules in the Lib dir topic-tkinter type-feature A feature request or enhancement

Comments

@Xiaokang2022
Copy link
Contributor

Xiaokang2022 commented Nov 16, 2024

Feature or enhancement

Proposal:

Add the argument **kw to the method after so that the keyword argument can passed to func Conveniently.

The current function definition of the after is as follows:

def after(self, ms, func=None, *args): ...

If we have the argument **kw, we can do this:

import tkinter

root = tkinter.Tk()
root.after(1000, root.configure, bg="red")
root.mainloop()

Otherwise, we may need something like this:

import tkinter

root = tkinter.Tk()
root.after(1000, lambda: root.configure(bg="red"))
root.mainloop()

Obviously, the lambda here looks a bit redundant.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

@Xiaokang2022 Xiaokang2022 added the type-feature A feature request or enhancement label Nov 16, 2024
@picnixz picnixz added topic-tkinter stdlib Python modules in the Lib dir labels Nov 16, 2024
terryjreedy pushed a commit that referenced this issue Dec 1, 2024
…_idle` (#126900)


---------
Co-authored-by: Serhiy Storchaka <[email protected]>
picnixz pushed a commit to picnixz/cpython that referenced this issue Dec 2, 2024
….after_idle` (python#126900)


---------
Co-authored-by: Serhiy Storchaka <[email protected]>
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this issue Jan 8, 2025
….after_idle` (python#126900)


---------
Co-authored-by: Serhiy Storchaka <[email protected]>
ebonnal pushed a commit to ebonnal/cpython that referenced this issue Jan 12, 2025
….after_idle` (python#126900)


---------
Co-authored-by: Serhiy Storchaka <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir topic-tkinter type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants