Why? If your reason is self-documenting code for somebody implementing
an external backend, we can probably work something out.
If the reason is because it will somehow save time in subclasses, that's
a bad approach because backends are almost always going to need to
subclass the various classes and they should initialise attributes with
the right instances.
The engineering with putting "example" implementation code in __init__
is that there's going to be a very strong instinct (and many
code-checker tools will warn if you don't) to call super(...).__init__
and that would be a mistake in this case.
I think the first goal -- making it easy for people to write external
backends -- is a good one. We should make that as easy as possible and
code usually speaks louder than rewriting the code in English calling it
documentation at that level. But the good practices problem is an issue
here. We can work something out there if that's the motivation behind
your request. If there's some other reason, write some more.
Regards,
Malcolm
Yeah, okay. So validation is kind of the exception there. We should try
to work out a way to make this easier, you're right.
Can you open a ticket so that we don't forget this? It should be pretty
low-pain, modulo being careful not to set people up for a fall, and
certainly can't hurt things (and will help).
Regards,
Malcolm