dry-python/classes

Require strict `delegate=` subtyping

sobolevn opened this issue · 0 comments

Right now - any type can be a delegate. We don't check anything, unless it is used as instance annotation.
But, it leads to potential errors. One can use different delegate and instance types.

It would be hard to debug, why your instance handler is not called / crashes in runtime.

So, the solution is to require delegate= to be a strict subtype of instance type.