Marti Raudsepp
Marti Raudsepp
I have rebased and updated this PR.
If you can't figure this out, I'll probably find time to reduce this to a reproducer by the end of the week.
> Tests not written, looks like it haven't things to test. Yeah, don't worry about tests for `.pyi` files. Unless it's a particularly complicated case of decorators or generics.
> But bash ./scripts/stubtest.sh gives: > Found 3010 errors (checked 888 modules) Try removing `.mypy_cache` before running `stubtest`. There seems to be a bug, but I haven't bothered to debug/report...
There was some earlier discussion about supporting multiple Django versions in #262 and draft PR in #288.
> This feature can't be worked on unless PEP 696 is accepted I think we don't necessarily have to wait for acceptance of the PEP. As long as it's implemented...
> For each addition on the main branch, we could backport changes to a 4.2.x branch if the addition isn't Django 5 only. It's possible, but personally I have no...
Indeed as @mschoettle mentions, this has been solved for a long time, it has been publicly exported from `django_stubs_ext`. And `ValuesQuerySet` is now being deprecated in favor of `QuerySet[T, U]`....
Looking at the code, it checks for the existence of the `resolve_expression` method, so `BaseExpression` seems like a more accurate type.
Ah sorry. Seems like a good idea, although not a fan of the monkeypatching. What gave me pause is that I imagine some people might be using the `ready()` callbacks...