On Sat, Jul 16, 2011 at 10:04 AM, Ben Finney <ben+pyt...@benfinney.id.au> wrote: > def study(self, subject): > raise NotImplementedError > > See? We can have overstretched analogies *and* remain within the Liskov > substitution principle. >
Hehe! Of course I was speaking utterly in jest, but this raises (sorry, never could resist a bad pun) another question: What if the base class implemented study(), and then LazyStudent subclasses Student but makes study() raise NotImpl? Would that break things? In a sense, it breaks the whole "this is a student so it should act like a student" rule. Suppose it raised UtterApathyError instead - does that break the LSP? Chris A PS. The world's first horseless signature... trapped in the air! -- http://mail.python.org/mailman/listinfo/python-list