Borg identity [was Re: why () is () and [] is [] work in other way?]

Chris Angelico rosuav at gmail.com
Fri Apr 27 13:38:09 EDT 2012


On Sat, Apr 28, 2012 at 3:33 AM, Adam Skutt <askutt at gmail.com> wrote:
> I think you misunderstood me.  Define a Borg class where somehow
> identity is the same for all instances.  Inherit from that class and
> add per-instance members.  Now, identity can't be the same for all
> instances.  As a result, you've just violated the Liskov Substituion
> Principal: code that relies on all Borg class instances having the
> same identity will fail when passed an instance of the subclass.

Why would you subclass a Borg?

ChrisA



More information about the Python-list mailing list