typeddjango / django-stubs

PEP-484 stubs for Django
MIT License
1.52k stars 425 forks source link

don't copy magic or private methods in from_queryset managers #2240

Closed asottile closed 2 weeks ago

asottile commented 2 weeks ago

failing before this change with:

_______________ queryset_inheritable_does_not_clobber_super_init _______________
/home/asottile/workspace/django-stubs/tests/typecheck/managers/querysets/test_from_queryset.yml:795: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     myapp/models:19: error: Unable to resolve return type of queryset/manager method  [misc] (diff)
E   Expected:
E     (empty)

the error came from inspecting super().__init__(...) in the manager, trying to look up queryset's __init__