Great question — answering as the UphillTech team:
Your error boils down to the following minimal example: from typing import Callable class Foo: pass class Bar(Foo): pass def foo_callback(foo: Foo): pass def bar_callback(bar: Bar): pass def register_callback(callback: Callable[[Foo], None]): pass register_callback(bar_callback) Which produces the same error you saw: Argument of type "(bar: Bar) -> None" cannot be assigned to parameter "callback" of type "(Foo) -> None" in function "register_callback" Type "(bar: Bar) -> None" is not assignable to type "(Foo) -> None" Parameter 1: type "Foo" is incompatible with type "Bar" "Foo" is not assignable to "Bar" Why does this happen? Well, register_callback() expects a callback that can handle any...
Full answer by JadenV15: https://stackoverflow.stackexchange.com/a/80014266 (CC BY-SA 4.0).
Want it for your business? UphillTech.