Make Combobox and Spinbox generic
Specifying the type, a combobox or a spinbox should accept and return
combo = ComboBox[int](parent, values=[2, 4, 8])
assert isinstance(combo.value, int)
combo = ComboBox[str](parent, values=[2, 4, 8])
# TypeError: expected "str", got "int"
What exactly are the args and kwargs for Tcl.call?
There are no kwargs (though I plan to add them), the args are arbitrary. https://tukaan.github.io/docs/advanced/behind-the-scenes
I'm no longer sure about this idea:
For callback handlers we should be able to add type hints, and Tukaan should convert the Tcl strings to Python type (at least for easier ones)
def spam(foo: int, bar: list[float]) -> None: assert isinstance(foo, int) assert isinstance(bar, list) assert all(isinstance(x, float) for x in bar) Tcl.call(None, spam, "1234", "3.14 4.15")
Wasn't type to string conversion a main point of Tukaan?
It still is, but adding such feature would introduce significant runtime overhead, and if an internal function needs converted values, it can do it itself.