What is the semantics meaning of 'object'?

Chris Angelico rosuav at gmail.com
Tue Jun 25 18:47:58 EDT 2013


On Wed, Jun 26, 2013 at 8:27 AM, Mark Janssen <dreamingforward at gmail.com> wrote:
> Here's how it *should* be made:  the most superest, most badassed
> object should take care of its children.  New instances should
> automatically call up the super chain (and not leave it up to the
> subclasses), so that the parent classes can take care of the chil'en.
>  When something goes wrong the parent class has to look in and see
> what's wrong.

So what you're saying is that the first class defined does everything,
and subclasses _restrict_ what can be done? I disagree strongly:

1) That breaks the Liskov Substitution Principle. A subclass of list
ought to fulfill the contracts of a basic list.

2) It implies that someone can invent an all-encompassing superclass
before any subclassing is done. This kinda violates the laws of
information. Programmers, being creative entities, will be adding to
the pool of knowledge. Trying to shoehorn everything into one object
won't work.

It may be that you're not saying that, but you mean that the
superclass decides which subclass's method to call. If that's what you
meant, then I really don't know how it would be any different from the
object itself making that decision, which is how things currently are.
Or are both these interpretations wrong?

ChrisA



More information about the Python-list mailing list