> On Feb 24, 2017, at 1:24 AM, Steve D'Aprano <steve+pyt...@pearwood.info> > wrote: > > On Fri, 24 Feb 2017 11:19 am, Irv Kalb wrote: > >> Hi, >> >> I have built a set of three classes: >> >> - A super class, let's call it: Base > [...] >> I would like to add is some "insurance" that I (or someone else who uses >> my code) never instantiates my Base class, It is not intended to be >> instantiated because some of the needed instance variables are only >> created in the __init__ method of ClassA and ClassB. > > class Base: > def __init__(self): > if type(self) is Base: > raise TypeError("cannot instantiate Base class") > > > Does that help? > >
Double D'oh!! That's exactly what I was looking for. (Why didn't I think of that?) Thanks very much! Irv -- https://mail.python.org/mailman/listinfo/python-list