[Python-Dev] use PyCObject (was: CVS: python/dist/src/PC msvcrtmodule.c,1.4,1.5 _winreg.c,1.5,1.6)

Mark Hammond mhammond@skippinet.com.au
Sun, 2 Jul 2000 10:21:30 +1000


> > This is exactly what we do.  Trents patches are just for the
> functions that
> > return the underlying handle value as an integer (which is definately a
> > useful thing to be able to do!)
>
> But I don't understand why you want an integer. From the Python
> programmer's
> standpoint, they just want a handle, right?

Yes - but there _are_ functions that return the integer.  This is used
mainly so the handles can be passed to external programs, or external API
functions wrapped via SWIG, etc.

The normal case is a "handle object".  The "handle object" has auto-close
ability.  The "handle object" _also_ has the ability to get the raw
underlying handle, should the programmer choose.

Im afraid you will never convince me this is wrong :-)

> Without using PyCObject, we'd need a complete handle type (like
> the one in
> win32api or wherever).

That is exactly what we have.  Sorry - I thought "CObject" was a generic
term for any C-implemented PyObject.

Mark.