beanie
beanie copied to clipboard
Fix: FindInterface type-hints break on View models
This PR adds a new TypeVar for View
just like DocType
, and is used in FindInterface
to bind it for each model with their respective model type.
It fixes a bug where find operations type-checks break when used with View
descendants. For example, see this issue.
Hi @GuyGooL5 , Could you please run pre-commit against your changes? Thank you for the PR!
Hi @roman-right, unfortunately I've found that my solution isn't all-inclusive and there are many edge cases, I'm drafting this PR and will work on it.
Hi @GuyGooL5 , Yes sure. Thank you for your work!
@roman-right I hope that's enough for a fix. I tested the type inference in VSCode and it seems to work, is there maybe a test I can implement to future-proof it from a static-type checker's perspective?
Hi @GuyGooL5 , Thank you for the PR! I'll check it this week
Hi @GuyGooL5 , Thank you for your work. Merged. It will be published in a few days
Great news, thanks.