-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
tkinter Widget do not accept .cget #4889
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
Comments
Currently You can already treat the widget as a dict, as in |
Yes it works and i use it a lot. I changed all my .config .configure and .cget to dict access just to use mypy... About #4363, it is a good idea, but we need also "generic" access to cget in Misc. Every Widget can override it without problems. |
Seems like #4363 is not working as intended at all. I changed all of my dict access code to use |
What a change! |
With this code:
Mypy output is:
I think that Misc should have a generic definition of cget() .
Something like this::
def cget(self, key: str) -> Any: ...
I tried this change and got no problem.
This case, indeed, is problematic:
Mypy output:
error: Cannot determine type of 'cget'
The workaround:
.configure has the same problem, but is more hard to fix.
The text was updated successfully, but these errors were encountered: