[C++-sig] Re: Re: Boost.Python v2: reference-counting and user-friendly conversions

Dave Hawkes daveh at cadlink.com
Fri Jun 14 02:54:03 CEST 2002


"David Abrahams" <david.abrahams at rcn.com> wrote in message
news:028e01c2132d$25672d10$6601a8c0 at boostconsulting.com...
> > that way we can also do:
> >
> >     call<void>(my_function, handle<>(borrow(PyImport_AddModule(name))))
>
> It just occurred to me that we can allow
>
>     call<void>(my_function, borrow(PyImport_AddModule(name)))
>
> as a convenience.

This seems just a contrivance really, I think it is still cleaner to
'disconnect' call from the whole new/borrowed reference symantics. Once the
function wrappers are in place it will be less of an issue anyway.

Also remember if someone really does want the reduced typing overhead of
passing in raw PyObjects it would be simple enough to create a templated
function wrapper that called the boost call function and wrapped the args in
appropriate handle<> constructs to steal the object anyway.

Dave Hawkes









More information about the Cplusplus-sig mailing list