On 3/22/06, Matthias Baas <ba...@ir...> wrote:
> Hi Roman,
>
> you might have seen that mail from the c++-sig already yourself. Can
> this be added to pyplusplus? (that is, whenever the default value for a
> pointer is 0, it is replaced by object())
>
> - Matthias -
Yes, I will do it. By the way why arg("...") ? Or should I replace
"..." with actual
name of argument?
> -------- Original Message --------
> Subject: Re: Providing a default value for a pointer argument
> Date: Wed, 22 Mar 2006 07:16:46 -0800
> From: David Abrahams <da...@bo...>
> Reply-To: Development of Python/C++ integration <c+...@py...>
> Newsgroups: gmane.comp.python.c++
> References: <dvrjiv$d6j$1...@se...>
>
> Matthias Baas <ba...@ir...> writes:
>
> > Hi,
> >
> > I have a question about the "arg" class which can be used to provide
> > names for keyword arguments and their default values. Should this
> > default value also be taken into account for arguments that are actuall=
y
> > pointers?
> > I have a function that takes a pointer as input whose default value in =
C
> > is 0. When I wrap that function I provide the default value as
> > arg("...")=3D0.
>
> Try
>
> arg("...") =3D object()
>
> object() produces a None, and None is the canonical object that's
> convertible to NULL pointers.
>
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
|