Boost C++ Libraries: Ticket #2909: [Fix in git] Wrong type signatures?
https://svn.boost.org/trac10/ticket/2909
<p>
In python/converter/builtin_converters.hpp, I found these lines:
</p>
<p>
BOOST_PYTHON_TO_PYTHON_BY_VALUE(signed BOOST_PYTHON_LONG_LONG, ::PyLong_FromLongLong(x), &PyInt_Type)
BOOST_PYTHON_TO_PYTHON_BY_VALUE(unsigned BOOST_PYTHON_LONG_LONG, ::PyLong_FromUnsignedLongLong(x), &PyInt_Type)
</p>
<p>
and,
</p>
<p>
BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::wstring, ::PyUnicode_FromWideChar(x.data(),implicit_cast<ssize_t>(x.size())), &PyString_Type)
</p>
<p>
Seems it is a typo. Should the PyInt_Type be PyLong_Type, and the PyString_Type be PyUnicode_Type?
</p>
<p>
These macro argument is used for generate the return value of get_pytype(). And seems get_pytype() is only used to generate docstring. So there's accutally no problem caused by these.
</p>
<p>
But, should these be typo? If so, we'd better fix it.
</p>
<p>
Thanks!
</p>
en-usBoost C++ Libraries/htdocs/site/boost.png
https://svn.boost.org/trac10/ticket/2909
Trac 1.4.3Haoyu BaiFri, 03 Apr 2009 13:16:59 GMTcc set
https://svn.boost.org/trac10/ticket/2909#comment:1
https://svn.boost.org/trac10/ticket/2909#comment:1
<ul>
<li><strong>cc</strong>
<span class="trac-author">divinekid@…</span> added
</li>
</ul>
TicketDave AbrahamsMon, 06 Apr 2009 10:03:16 GMT
<link>https://svn.boost.org/trac10/ticket/2909#comment:2 </link>
<guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2909#comment:2</guid>
<description>
<p>
The best way to know if these are bugs that need to be fixed is to produce test cases (a .cpp and a matching .py file—see <a class="ext-link" href="https://svn.boost.org/trac/boost/browser/trunk/libs/python/test"><span class="icon"></span>this directory</a> for examples) that currently fail and would stop failing if the fixes were made. Can you do that and post an attachment?
</p>
<p>
Thanks!
</p>
</description>
<category>Ticket</category>
</item>
<item>
<dc:creator>Haoyu Bai</dc:creator>
<pubDate>Wed, 08 Apr 2009 07:50:33 GMT</pubDate>
<title>attachment set
https://svn.boost.org/trac10/ticket/2909
https://svn.boost.org/trac10/ticket/2909
<ul>
<li><strong>attachment</strong>
→ <span class="trac-field-new">typetypo.diff</span>
</li>
</ul>
<p>
Patch to fix the typo
</p>
TicketHaoyu BaiWed, 08 Apr 2009 07:51:58 GMTattachment set
https://svn.boost.org/trac10/ticket/2909
https://svn.boost.org/trac10/ticket/2909
<ul>
<li><strong>attachment</strong>
→ <span class="trac-field-new">typetypo.cpp</span>
</li>
</ul>
<p>
Testcase showing the problem.
</p>
TicketHaoyu BaiWed, 08 Apr 2009 07:52:57 GMTattachment set
https://svn.boost.org/trac10/ticket/2909
https://svn.boost.org/trac10/ticket/2909
<ul>
<li><strong>attachment</strong>
→ <span class="trac-field-new">typetypo.py</span>
</li>
</ul>
<p>
Testcase showing the problem.
</p>
TicketHaoyu BaiWed, 08 Apr 2009 08:08:13 GMT
<link>https://svn.boost.org/trac10/ticket/2909#comment:3 </link>
<guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2909#comment:3</guid>
<description>
<p>
Testcase and patch attached.
</p>
<p>
Without the patch, the test giving the following result:
</p>
<pre class="wiki">Docstring say:
return_longlong() -> int :
C++ signature :
long long return_longlong()
But actually type of return value is: <type 'long'>
Docstring say:
return_wstring() -> str :
C++ signature :
std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > return_wstring()
But actually type of return value is: <type 'unicode'>
</pre><p>
Notice the "return_longlong() -> int" and "return_wstring() -> str".
</p>
<p>
With the patch, the result seems correct:
</p>
<pre class="wiki">Docstring say:
return_longlong() -> long :
C++ signature :
long long return_longlong()
But actually type of return value is: <type 'long'>
Docstring say:
return_wstring() -> unicode :
C++ signature :
std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > return_wstring()
But actually type of return value is: <type 'unicode'>
</pre><p>
Also, this patch don't affect other test cases, as they are all passed. I think it is just related to the docstring and won't touch any other things.
</p>
</description>
<category>Ticket</category>
</item>
<item>
<dc:creator>troy d. straszheim</dc:creator>
<pubDate>Mon, 12 Oct 2009 21:37:30 GMT</pubDate>
<title>owner changed
https://svn.boost.org/trac10/ticket/2909#comment:4
https://svn.boost.org/trac10/ticket/2909#comment:4
<ul>
<li><strong>owner</strong>
changed from <span class="trac-author">Dave Abrahams</span> to <span class="trac-author">troy d. straszheim</span>
</li>
</ul>
<p>
Looks like the fix made it to the trunk, but not the test, and I notice:
</p>
<blockquote class="citation">
<blockquote class="citation">
<blockquote class="citation">
<p>
print return_string.<span class="underline">doc</span>
</p>
</blockquote>
</blockquote>
</blockquote>
<p>
return_string() -> str :
</p>
<blockquote>
<p>
C++ signature :
</p>
<blockquote>
<p>
std::string return_string()
</p>
<blockquote class="citation">
<blockquote class="citation">
<blockquote class="citation">
<p>
print return_wstring.<span class="underline">doc</span>
</p>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<p>
return_wstring() -> unicode :
</p>
<blockquote>
<p>
C++ signature :
</p>
<blockquote>
<p>
std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > return_wstring()
</p>
</blockquote>
</blockquote>
<p>
that that basic_string<wchar... should be simplified to std::wstring for readability. Working on it.
</p>
Tickettroy d. straszheimMon, 12 Oct 2009 22:44:10 GMTsummary changed
https://svn.boost.org/trac10/ticket/2909#comment:5
https://svn.boost.org/trac10/ticket/2909#comment:5
<ul>
<li><strong>summary</strong>
<span class="trac-field-old">Wrong type signatures?</span> → <span class="trac-field-new">[Fix in git] Wrong type signatures?</span>
</li>
</ul>
<p>
Fix here:
</p>
<p>
<a class="ext-link" href="http://gitorious.org/~straszheim/boost/straszheim/commit/aeefdf7abca8c33c25a98a5f7fc78e4e888f9c94"><span class="icon"></span>http://gitorious.org/~straszheim/boost/straszheim/commit/aeefdf7abca8c33c25a98a5f7fc78e4e888f9c94</a>
</p>
<p>
also clean up printing of std::wstring as the gcc demangler was being messy about it.
</p>
Ticket