Re: Liskov substitution principle

2011-07-15 Thread Ben Finney
Chris Angelico writes: > 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. That would break the Liskov subst

Re: Liskov substitution principle (was: list(), tuple() should not place at "Built-in functions" in documentation)

2011-07-15 Thread Chris Angelico
On Sat, Jul 16, 2011 at 10:04 AM, Ben Finney 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 (so