Skip to content

Conversation

@Akuli
Copy link
Collaborator

@Akuli Akuli commented Aug 18, 2020

This code doesn't type check correctly with what's currently on master. This PR fixes it.

import tkinter.ttk

tkinter.Tk().config
tkinter.Toplevel().config
tkinter.Button().config
tkinter.Canvas(offset=1).config
tkinter.Checkbutton().config
tkinter.Entry().config
tkinter.Frame().config
tkinter.Label().config
tkinter.Listbox().config
tkinter.Menu().config
tkinter.Menubutton().config
tkinter.Message().config
tkinter.Radiobutton().config
tkinter.Scale().config
tkinter.Scrollbar().config
tkinter.Text().config
tkinter.OptionMenu(None, tkinter.StringVar(), 'foo').config
tkinter.Spinbox().config
tkinter.LabelFrame().config
tkinter.PanedWindow().config
tkinter.ttk.Button().config
tkinter.ttk.Checkbutton().config
tkinter.ttk.Entry().config
tkinter.ttk.Combobox().config
tkinter.ttk.Frame().config
tkinter.ttk.Label().config
tkinter.ttk.Labelframe().config
tkinter.ttk.Menubutton().config
tkinter.ttk.Notebook().config
tkinter.ttk.Panedwindow().config
tkinter.ttk.Progressbar().config
tkinter.ttk.Radiobutton().config
tkinter.ttk.Scale().config
tkinter.ttk.Scrollbar().config
tkinter.ttk.Separator().config
tkinter.ttk.Sizegrip().config
tkinter.ttk.Treeview().config
tkinter.ttk.LabeledScale().config
tkinter.ttk.OptionMenu(None, tkinter.StringVar(), 'foo').config

I'm sorry for not noticing this earlier. The project I used for testing the stubs used __setitem__ instead of config and configure. I converted it to use config and configure when I found this problem.

@Akuli Akuli changed the title fix config methods fix tkinter config methods Aug 18, 2020
@Akuli
Copy link
Collaborator Author

Akuli commented Aug 22, 2020

In case someone runs into this before it gets merged, you can still use configure instead of config, and some_toplevel['option'] = value instead of some_toplevel.config(option=value)

@Akuli
Copy link
Collaborator Author

Akuli commented Aug 24, 2020

Any update on this?

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

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

LGTM after a cursory inspection.

@srittau srittau merged commit ff35f99 into python:master Aug 24, 2020
@Akuli Akuli deleted the config-fix branch August 24, 2020 11:35
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.

2 participants