Open intgr opened 4 months ago
Typecheckers cannot see beyond the
*args: Any, **kwargs: Any
arguments, they will allow literally anything as long as the first 2 arguments are satisfied.In order to fix this, it would be necessary to add complete signatures, duplicating the arguments from DRF itself.
I see.
What I would like is to inform what this mixing "soft-inherits" from, but without really creating an inheritance. Duplicating code from DRF is not something that I want. In fact, DRF made some small internal adjustment so drf-nested-routers
got able to override just a little part of the routers, instead of copy-pasting some lines.
That makes me think that DRF may be open to small changes that facilitate what you want, if this does not reduce their code readability.
I'm not sure if you want this complexity, but I wanted to demonstrate what can be still improved.
Because
NestedMixin
is declared as:Typecheckers cannot see beyond the
*args: Any, **kwargs: Any
arguments, they will allow literally anything as long as the first 2 arguments are satisfied.In order to fix this, it would be necessary to add complete signatures, duplicating the arguments from DRF itself.