typeddjango / djangorestframework-stubs

PEP-484 stubs for django-rest-framework
MIT License
439 stars 115 forks source link

Replace `Manager` with `BaseManager` #508

Closed intgr closed 10 months ago

intgr commented 10 months ago

@flaeppe This is some example fallout from https://github.com/typeddjango/django-stubs/pull/1814 since RelatedManager base class was changed from Manager to BaseManager.

Without this change, I can no longer pass RelatedManagers to APIs that accept them.

I'm not entirely happy or sure about this. I think in pratice most managers, including RelatedManagers, do inherit from Manager.

BaseManager seems to be intended as an impementation detail in Django, not something users should be exposed to. But this will force users to replace Manager type hints with BaseManager, including my personal projects.

Related issues

intgr commented 10 months ago

Closing this, looks like we'll be reversing the change in django-stubs instead: