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
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
> 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
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
> 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
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
> 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
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
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