Re: True Inheritable Classes In C (was Generic Interface)

Dianne Hackborn (hackbod@saurian.CS.ORST.EDU)
4 Mar 1995 08:16:13 GMT

Hark! The herald Donald Beaudry <don@dvcorp.com> posts:
| Currently this functionality does not exist. Not unless you implement
| your own Class/Instance classes and find a way to get the intepreter
| to instantiate them when it executes a 'class' statement. But, it
| just so happens that I have done this. Version 1.2 of Python has the
| necessary hooks in place to make it work, and I have a whole pile of
| code for doing the sub-classing. All it needs now is a little bit of
| documentation (well maybe a lot of documentation). You can expect to
| see a public release of my extentions shortly after the official
| public release of 1.2. For more information you might take a look at
| the paper I wrote for last November's workshop.
|
| http://www.eeel.nist.gov:80/python/workshop11-94/
|
| Feel free to ask questions, I have to start on the documentation sometime :)

Great, this looks like just the kind of thing I was looking for. Actually,
more than I was looking for, but I won't complain. ;)

Does the paper you have on-line reflect how the implementation will be
under Python 1.2, with the new extensions? The description of the
MetaClass instance make it sound like these classes would possibly appear
different to the Python program than the standard classes... or is the
syntax something like -

MyBaseClase(MetaClass):
...

And is it likely that this class system will at some point become a
standard part of the Python language? How much additional code does this
implementation need, in comparison to the current class implementation?

Off on a completely different direction... since you've been doing work on
the Xt and Motif stuff, I'm wondering how you have handled argument lists?
It seems like it would be very nice, not only in this situation, to be able
to do something similar to arguments when instantiating classes. In
particular, I've been thinking of a "Tag" type, which would be a Python
type which identifies a specific argument and what type it should be.
Basically much like how X argument lists [and AmigaDOS tag lists ;)] work,
allowing both C and Python programs to define new tags. A tag would
probably also have a method which takes the argument following it and
returns a boolean indicating whether it is of the correct type. It seems
like your CType system would make this much more workable, as you would
have that dictionary of available types.

----------------------------------------------------------------------------
Dianne Kyra Hackborn "Gail has said in interviews that one of the
hackbod@mail.cs.orst.edu things that makes our relationship work is the
Oregon State University fact that we hardly ever get to talk to each
//www.cs.orst.edu/~hackbod/ other." -- Frank Zappa