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

Joel de Guzman djowel at gmx.co.uk
Thu Sep 11 17:10:11 CEST 2003


David Abrahams <dave at boost-consulting.com> wrote:
> "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.

Thanks Dave. I'll document that fact.

-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net





More information about the Cplusplus-sig mailing list