FAQ

Maric Michaud a ?crit :
Le vendredi 08 septembre 2006 10:15, Bruno Desthuilliers a ?crit :

You
mentioned NotImplementedError, which is indeed the usual way to make
something "abstract" in Python.

Hummm, some more thoughts about this.

I can imagine class hierarchies where the presence of not implemented methods
doesn't mean that the class is actually an abstract one.
I can imagine this too - as well as I can imagine the nightmarish
spaghetti code that could use this class hierarchie.
Even if partial
implementation is not a common scheme it can save you from writing a lot of
classes.
A partial implementation should return default values, not raise (aka
NullObjectPattern). Well, IMHO at least.

(snip)
And this can become a true spider net for more complicated cases. Obviously,
in practice we will choose alternatives to inheritance (strategies,
visitors, ...)
Composition/delegation...
to work with such complex situations,
Indeed.

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 13 of 13 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedSep 8, '06 at 7:03a
activeSep 9, '06 at 6:24p
posts13
users6
websitepython.org

People

Translate

site design / logo © 2022 Grokbase