RE: [Tutor] design questions: pythonic approach to ostriches

2005-04-25 Thread Smith, Jeff
L PROTECTED] On Behalf Of Alan Gauld Sent: Sunday, April 24, 2005 3:48 AM To: Brian van den Broek; Tutor Subject: Re: [Tutor] design questions: pythonic approach to ostriches > I do remain a bit surprised that there seems to be no way to implement > what I naively thought would be the o

Re: [Tutor] design questions: pythonic approach to ostriches

2005-04-24 Thread Kent Johnson
Brian van den Broek wrote: I do remain a bit surprised that there seems to be no way to implement what I naively thought would be the obvious solution -- to remove an inherited method from the instance's dictionary. The thing is, the inherited method is never *in* the instance's dictionary. It's

Re: [Tutor] design questions: pythonic approach to ostriches

2005-04-24 Thread Alan Gauld
> I do remain a bit surprised that there seems to be no way to implement > what I naively thought would be the obvious solution -- to remove an > inherited method from the instance's dictionary. You can, as Kent said, override the method to do nothing. Some languages, like Eifell offer better supp

Re: [Tutor] design questions: pythonic approach to ostriches

2005-04-23 Thread Brian van den Broek
Danny Yoo said unto the world upon 2005-04-23 22:16: I do remain a bit surprised that there seems to be no way to implement what I naively thought would be the obvious solution -- to remove an inherited method from the instance's dictionary. Hi Brian, If we're trying to do this, we probably don't

Re: [Tutor] design questions: pythonic approach to ostriches

2005-04-23 Thread Danny Yoo
> I do remain a bit surprised that there seems to be no way to implement > what I naively thought would be the obvious solution -- to remove an > inherited method from the instance's dictionary. Hi Brian, If we're trying to do this, we probably don't want to "inherit" from a parent. A subclas

Re: [Tutor] design questions: pythonic approach to ostriches

2005-04-23 Thread Brian van den Broek
Alan Gauld said unto the world upon 2005-04-23 15:18: I am wondering about the Pythonic way to handle the problem of ostriches, emus, and penguins. (I cannot recall from where I got the example.) Its not really a Python issue its one of several similar conundrums in OOP in any language. Thanks Al

Re: [Tutor] design questions: pythonic approach to ostriches

2005-04-23 Thread Alan Gauld
> I am wondering about the Pythonic way to handle the problem of > ostriches, emus, and penguins. (I cannot recall from where I got the > example.) Its not really a Python issue its one of several similar conundrums in OOP in any language. My solution for this one: class Bird()... class Flightl

Re: [Tutor] design questions: pythonic approach to ostriches

2005-04-23 Thread Rich Krauter
Brian van den Broek wrote: Hi all, I am wondering about the Pythonic way to handle the problem of ostriches, emus, and penguins. (I cannot recall from where I got the example.) Here's what I mean: class Bird(object): def fly(self): # flying logic here def lay(self): # egg

Re: [Tutor] design questions: pythonic approach to ostriches

2005-04-23 Thread Kent Johnson
Brian, I think you have done a great job of demonstrating that design has to be evaluated in the light of requirements. There are probably scenarios where each of these solutions makes sense. Without knowing how it is to be used, there is no way to pick the 'right' one. For example in a bird sim