[docs] [issue18541] LoggerAdapter example is counter-productive
report at bugs.python.org
Wed Jul 24 16:49:52 CEST 2013
Antoine Pitrou added the comment:
> > But how is that necessary for the use case? Your LoggerAdapter-
> > derived class could take the "existing class" as a constructor
> > parameter (*), then inject the required info in its overriden
> > process() method.
> If you can adapt an existing class to look sufficiently like a dict,
> that's all you need to do - there's no need to subclass
> LoggerAdapter and override process(). There might be cases where
> that's the easier option.
I am not talking about "adapting a class". I am taking about overriding
process() to do the adapting in a simpler way than in your example.
Python tracker <report at bugs.python.org>
More information about the docs