mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-06-14 03:29:47 +08:00
e9ecea0033
In tkinter, `widget['foo'] = bar` and `widget.config(foo=bar)` do the same thing, but they will now type-check differently: the `widget['foo'] = bar` syntax allows 'foo' to be any string (e.g. a variable, not necessarily a Literal) and bar to be any object, while `widget.config(foo=bar)` checks the existence of the option and the type of bar. Similarly, cget takes a Literal argument but __getitem__ takes a string. Testing script can still be found at https://github.com/python/typeshed/pull/4363/commits/c42a72c53e552ab501455def07017181f0158e80