[C++-sig] Re: Boost.Python bug found

David Abrahams dave at boost-consulting.com
Thu Sep 11 16:20:17 CEST 2003


"Roman Yakovenko" <romany at actimize.com> writes:

>  
>      Hi. I think I find bug. 
>  Description. I wrote converter for std::wstring from\to 
>  PyUnicodeObject.
>  ( Thanks to Ralf W. Grosse-Kunstleve and his article 
>  Converting CString to/from std::string )
>  
>  After registration it works pretty well ( for me ). But if I 
>  want to expose 
>  std::vector< std::wstring > using vector_indexing_suite I get 
>  error message:
>  
>  TypeError: No Python class registered for C++ class class 
>  _STL::basic_string<unsigned short,class 
>  _STL::char_traits<unsigned short>,class 
>  _STL::allocator<unsigned short> >
>
>  Also the same bug happens with def_readwrite function.
> But I don't have small reproducable case. 

It's not a bug.  The problem is that the use of proxies in an indexing
suite requires that the element type be wrapped as a class.  You can
either expose class_<std::wstring>... (etc) or you can pass NoProxy =
true to the indexing suite.

HTH,

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





More information about the Cplusplus-sig mailing list