Mathieu Bouchard wrote:
> 
>...
> 
> Well, if a programmer never-ever declares anything, he gets a result that
> goes with his effort. A lot of declarations may be dead weight, but if you
> use an empty module called FileP (or FileInterface) and include it into
> all File-compatible classes, then you can add write3lines easily like
> this, by reusing your interface module as a mixin module:

This style is possible in both Python and Ruby but it hasn't caught on
in the Python world. I think that the conceptual problem is that
FileInterface really needs to be broken down into ReadFile and
WriteFile. And then SeekableReadFile, NonSeekableReadFile,
SeekableWriteFile and NonSeekableWriteFile. And then Bidirectional and
ForwardOnly etc. etc. It quickly explodes into a mess of interfaces.
-- 
Take a recipe. Leave a recipe.  
Python Cookbook!  http://www.ActiveState.com/pythoncookbook