[Python.NET] Python.NET and COM CoClasses

Bruce Dodson bruce_dodson at hotmail.com
Wed Mar 31 14:44:31 EST 2004


That did help; I see what's going on that I missed.  In the typelib, one of the 
CoClasses is called PropertySet, and has a default interface IPropertySet.  The 
way this gets exposed, PropertySet shows up in .NET as an interface 
(approximately an alias for IPropertySet), whereas the coclass gets exposed as 
PropertySetClass.  I guess this is necessary since, in many cases, the default 
interface is an unnamed dispatch or dual interface.  Since PropertySet cannot 
be overloaded to be both the name of a coclass and the name of an interface, 
the suffix is appended to avoid a name collision.

I think Python.NET should expose the objects by their mangled names (since that 
matches C#) but should also apply some syntactic sugar to allow you to 
instantiate them with their original names (since that matches win32com, not to 
mention the intent of the library authors).

Bruce




More information about the PythonDotNet mailing list