On 21.10.2015 00:50, Chris Angelico wrote:
She recommends a massive superclass that's capable of any form of injection
Nope. She does not.
The "superclass" is not "massive" at all. It is even slimmer as
orthogonal aspects are refactored out into separate entities. In
fact, it makes it even easier to test and maintain these separate
aspects (the core dev should be interested in that). Furthermore,
it's, of course, up to debate which aspects should be injectable and
which are not.
Just imagine, I would need to use several orderings and/or a default
value for missing keys:
normal_dict = dict()
ordered_dict = dict(order=dict.order_by_insert)
sorted_dict = dict(order=sorted)
sorted_default_dict = dict(order=sorted, default=int)
How many subclasses am I supposed to write, maintain and upgrade (in
case Guido rewrites his precious dict implementation)? I would even
allege that for sufficiently large teams and projects, there are multiple
implementations with the same intent.
PS: the instances above are real-world examples, I remember
requiring during the course of the last year.