I have an if block and I need to put a few comparisons in it for example:
if type(widget1) is tk.Entry or type(widget1) is tk.OptionMenu or type(widget1) is tk.Label:
# do something
As you can see I am writing type(widget1) thrice. Instead, is there an easier way to do this?
if type(widget1) is tk.OptionMenu or tk.Entry or tk.Label:
# do something
I know the above code wouldn't work here but just asking, is there an easier way to do it? I am making these kind of comparisons in multiple places, and so it would be helpful to write less. This isn't really a tkinter question, anyone can answer!! Thanks in advance!