[python-win32] Registering a Server COM to make it visible in thereference list

Mark Hammond mark at enfoldsystems.com
Thu Aug 2 17:18:50 CEST 2007

> On 7/30/07, Mark Hammond <mhammond at skippinet.com.au> wrote:
> > There should be no need to create an IDL file - enough interfaces are
> > exposed so that we can create the typelib directly.
> Ah, after some looking around, I see that there is
> pythoncom.CreateTypeLib and CreateTypeLib2.  Is this what you mean?


> I was assuming the use of decorators, but it also may be possible to
> just extend the current class variable syntax.

> The other idea I had was to use something like zope.interface where
> one defines the interfaces in a separate class.  This sits half way
> between using something like IDL where the interfaces are in a
> separate file (and different language) and using decorators / class
> variables where your class has all the information.  The advantage
> that I can see is that it makes it clearer to the programmer when they
> need to change the version number / GUID of the typelib.  If they
> change the interface class, they need to change the version number.
> If they just change the implementation class, they do not.  It may
> also make it easier to write unit tests to check that the
> implementation class complies with the interface.

I think that is getting a bit too heavy-weight - if people really want
formal interface definitions, then they can stick with the IDL and having
their Python code reference the typelib.  I'm more interested in an
"informal" approach where people can create a typelib for the benefit of
other languages but without adding too much overhead.



More information about the python-win32 mailing list