Re: Python supports LSP, does it?

2005-08-12 Thread en.karpachov
On Thu, 11 Aug 2005 15:02:08 -0400 Terry Reedy wrote: I remember discussion of the LSP on comp.object some years ago when I was reading it. (I presume there still are, just don't read it anymore.). One of the problems is that biology and evolution do not obey it. Birds (in general) can

Re: Python supports LSP, does it?

2005-08-11 Thread en.karpachov
On Thu, 11 Aug 2005 01:19:19 +0100 phil hunt wrote: According to Wikipedia, the Liskov substitution principle is: Let q(x) be a property provable about objects x of type T. Then q(y) should be true for objects y of type S where S is a subtype of T To me, this is nonsense. Under this

Re: Python supports LSP, does it?

2005-08-11 Thread Terry Reedy
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Thu, 11 Aug 2005 01:19:19 +0100 phil hunt wrote: According to Wikipedia, the Liskov substitution principle is: Let q(x) be a property provable about objects x of type T. Then q(y) should be true for objects y of type S where

Re: Python supports LSP, does it?

2005-08-11 Thread Kay Schluehr
[EMAIL PROTECTED] wrote: On Thu, 11 Aug 2005 01:19:19 +0100 phil hunt wrote: According to Wikipedia, the Liskov substitution principle is: Let q(x) be a property provable about objects x of type T. Then q(y) should be true for objects y of type S where S is a subtype of T To

Re: Python supports LSP, does it?

2005-08-11 Thread Mike Meyer
Gregory Bond [EMAIL PROTECTED] writes: phil hunt wrote: Let q(x) be a property provable about objects x of type T. Then q(y) should be true for objects y of type S where S is a subtype of T To me, this is nonsense. Under this definition any subtype must behave the same as its parent type,

Re: Python supports LSP, does it?

2005-08-10 Thread bruno modulix
Roy Smith wrote: Andy Leszczynski leszczynscyATnospam.yahoo.com.nospam writes: (snip) It's not a true statement. Nothing in the language enforces LSP. In fact, there's not even a [way?] when a function/method is invoked to make sure the type passed in is a subtype of the type you expect

Re: Python supports LSP, does it?

2005-08-10 Thread Andy Leszczynski
Mike Meyer wrote: [...] The wikipedia was really abusing the phrase LSP. I've corrected the wikipedia. mike thx for changing. The credit for pointing it out blongs to me friend from work. Cheers, A. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python supports LSP, does it?

2005-08-10 Thread Mike Meyer
bruno modulix [EMAIL PROTECTED] writes: Clearly, somethingElse is a subtype of baseClass, when derivedClass is not. Don't confuse suclassing with subtyping. issinstance() let you check for subclassing, not for subtyping. The only language-level mechanism I know of that more or less inforce LSP

Re: Python supports LSP, does it?

2005-08-10 Thread phil hunt
On Tue, 09 Aug 2005 18:36:56 -0500, Andy Leszczynski leszczynscyATnospam.yahoo.com.nospam wrote: wikipedia (http://en.wikipedia.org/wiki/Python_programming_language#Object-oriented_programming) says: Python's support for object oriented programming paradigm is vast. It supports polymorphism

Python supports LSP, does it?

2005-08-09 Thread Andy Leszczynski
wikipedia (http://en.wikipedia.org/wiki/Python_programming_language#Object-oriented_programming) says: Python's support for object oriented programming paradigm is vast. It supports polymorphism [...] fully in the Liskov substitution principle-sense for all objects. Just wondering if it is

Re: Python supports LSP, does it?

2005-08-09 Thread Mike Meyer
Andy Leszczynski leszczynscyATnospam.yahoo.com.nospam writes: wikipedia (http://en.wikipedia.org/wiki/Python_programming_language#Object-oriented_programming) says: Python's support for object oriented programming paradigm is vast. It supports polymorphism [...] fully in the Liskov