I'm a bit ambivalent on adding such a class. Many features even in core
Python don't provide base classes and instead rely on duck-typing +
documentation. The amount of time saved globally will probably be less than
the time we've spent discussing it so far.

I think a more valuable piece of code would be the system check, since that
would validate it's all spelled correctly, for all developers, whether or
not their editor has auto-complete. It would also work going forwards
if/when the signatures change.

On Sun, 28 Apr 2019 at 10:35, Rick van Hattem <wo...@wol.ph> wrote:

> On Sun, 28 Apr 2019 at 11:30, Adam Johnson <m...@adamj.eu> wrote:
>
>> I don't think this would be that helpful, Django relies on ducktyping,
>> and the router docs (
>> https://docs.djangoproject.com/en/2.2/topics/db/multi-db/ ) clearly
>> document the signatures, and that the methods are all optional:
>>
>> A router doesn’t have to provide *all* these methods – it may omit one
>>> or more of them. If one of the methods is omitted, Django will skip that
>>> router when performing the relevant check.
>>
>>
> So in that case not a abstract base class but just a regular base class
> (which is why I placed the abstract part between ()). The advantage of
> having a base class is also that your editor can automatically complete the
> signature if you're planning to implement it.
>
> Would there be anything against it though? A non-abstract base class in
> that case :)
>
> ~rick
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CAJAwA%3DzhuM4OL0JzshGHQK2nLw9YL2aLtEjGqrQAOwyvYE6Wiw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-developers/CAJAwA%3DzhuM4OL0JzshGHQK2nLw9YL2aLtEjGqrQAOwyvYE6Wiw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Adam

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM0qzrRqDTkVA71emNs9773f5PjY___R-Xuk-Ucwg3JAcA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to