[Python-Dev] Re: PEP 282 comments (original) (raw)
Kevin Butler kbutler@campuspipeline.com
Fri, 22 Mar 2002 11:22:55 -0700
- Previous message: [Python-Dev] Re: asyncore 2.1.1/2.2 incompatibility
- Next message: [Python-Dev] Re: PEP 282 comments
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Following up on my own message:
[Kevin Butler]
the "simple subclass" now just needs to override log to do advanced things with other optional arguments.
I realized that this is a significant issue. In library design, the "Open-Closed" principle is really important - the code should be open to extension, but is closed to modification.
By adding the **kwargs to the convenience methods, the Logger opens itself to change and enables all subclasses to extend the interface by overriding _log with more keyword arguments. Without **kwargs, subclasses have to override _log and every one of the convenience methods (1.5K of duplicated code).
Setting-myself-up-for-YAGNI-ly y'rs,
kb
- Previous message: [Python-Dev] Re: asyncore 2.1.1/2.2 incompatibility
- Next message: [Python-Dev] Re: PEP 282 comments
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]