[C++-sig] Re: Pyste bug: operator! shouldn't be translated

David Abrahams dave at boost-consulting.com
Sat Oct 4 14:10:31 CEST 2003


"Niall Douglas" <s_sourceforge at nedprod.com> writes:

> A "friend FXVec4f operator!(const FXVec4f& a)" gets converted by 
> pyste into .def( !self ) which if I understand the BP docs correctly, 
> is not supported.
>
> Is there not any reason why this couldn't be added to Boost.Python 
> which AFAICS supports every operator except logical NOT? I can't see 
> any.

Which python special method would you like it to be translated into?
We could implement __nonzero__ as !!x, I guess.

> Other pyste bug: something like "operator float*()" converts into 
> ".def("to_float", &FX::FXVec4f::operator float*)" which is fine

really?  Why isn't it 

         .def(float_(self))

??

> but how do you specify the return policy??? 

A return policy for a Python float??  What did you have in mind?

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com





More information about the Cplusplus-sig mailing list