| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
A tkinter.Event represents something happening in a widget. The event's widget field is basically the widget that caused it. The somewhat misleadingly named Misc class means "any widget".
When writing an event handler function, you can specify the type of event.widget by using e.g. event: tkinter.Event[tkinter.Label]. Before this PR, it is required with strict type checker settings, and you get Any if you don't use it. With this PR, it is assumed to be Misc. This is suitable for event handlers that don't use the .widget field.
For example:
Mypy output before:
Mypy ouput with this PR:
The only reason why I didn't use default=Misc initially is that the default parameter didn't exist at the time.