[python-win32] Re: Desire information about Invoke and InvokeTypes

Mark Hammond mhammond at skippinet.com.au
Wed Apr 21 06:38:43 EDT 2004

> I didn't want to criticize you, the design decisions you made ;-).

I didn't take it as critisism :)

> I am just thinking that it *could* make more sense (in
> ctypes.com) to be
> more explicit.  So the above VB code would translate to ctypes.com:
> f = whatever.GetField()
> MessageBox("The field %s has value %d" (field.Item, field.Value))

This will work now, and would be the only way to make it work if you ignored
the default method/property.  In general, the "default" method/property is
an alias for an explicit one.

But in many respects, the problem is with Python, and the fact it calls
str() before doing a print.  If you ignore the 'print' issue, it makes
perfect sense for a Python object wrapping a COM object to provide __str__
and __int__ overloads when the COM object asserts it provides these
semantics.  I recall Guido also lamenting the same issue, but his time
machine failed in that regard.


More information about the Python-win32 mailing list