Borg identity

Ben Finney ben+python at benfinney.id.au
Fri Apr 27 21:27:51 EDT 2012


Adam Skutt <askutt at gmail.com> writes:

> On Apr 27, 12:56 pm, Steven D'Aprano <steve
> +comp.lang.pyt... at pearwood.info> wrote:
> > On Thu, 26 Apr 2012 04:42:36 -0700, Adam Skutt wrote:
> > > Steven D'Aprano wrote:
> > >> The Borg design pattern, for example, would be an excellent
> > >> candidate for ID:identity being treated as many-to-one.
> >
> > > How would inheritance work if I did that?
> >
> > You don't inherit from Borg instances, and instances inherit from
> > their class the same as any other instance.
>
> I think you misunderstood me.  Define a Borg class where somehow
> identity is the same for all instances.

The resulting class would not follow the Borg pattern, so it's not a
Borg class.

Remember that Borg names a design pattern, so if you've got a class that
doesn't follow that pattern then a complaint that it doesn't keep the
promises of the Borg pattern is merely tautological.

-- 
 \        “The deepest sin against the human mind is to believe things |
  `\           without evidence.” —Thomas Henry Huxley, _Evolution and |
_o__)                                                    Ethics_, 1893 |
Ben Finney



More information about the Python-list mailing list