[C++-sig] [patch] signatures/docstrings formatting
Neal Becker
ndbecker2 at gmail.com
Thu Sep 13 02:42:28 CEST 2007
# HG changeset patch
# User ndbecker2 at gmail.com
# Date 1189643327 14400
# Node ID f6e6ad1cbdc8d6c9736b3d261e6e5fd3e6823f2e
# Parent 056ace359968e07b83b67bed532796ec18f517c3
fix c++ sig
The current docstring signatures seem to confuse epydoc (using rst), because of
unexpected indentation. The following 2 patches seem to be a bit better:
diff -r 056ace359968 -r f6e6ad1cbdc8 libs/python/src/object/function.cpp
--- a/libs/python/src/object/function.cpp Wed Sep 12 19:05:52 2007 -0400
+++ b/libs/python/src/object/function.cpp Wed Sep 12 20:28:47 2007 -0400
@@ -544,9 +544,9 @@ void function::add_to_namespace(
if (docstring_options::show_cpp_signatures_)
{
if(len(_doc))
- _doc += "\n "+str(reinterpret_cast<const char*>(detail::cpp_signature_tag));
+ _doc += "\n"+str(reinterpret_cast<const char*>(detail::cpp_signature_tag));
else
- _doc += " "+str(reinterpret_cast<const char*>(detail::cpp_signature_tag));
+ _doc += str(reinterpret_cast<const char*>(detail::cpp_signature_tag));
}
if(_doc)
{
# HG changeset patch
# User ndbecker2 at gmail.com
# Date 1189643963 14400
# Node ID 33ce4a3bb451b917b315fa2400748955f794f546
# Parent f6e6ad1cbdc8d6c9736b3d261e6e5fd3e6823f2e
add newlines after python sig
diff -r f6e6ad1cbdc8 -r 33ce4a3bb451 libs/python/src/object/function.cpp
--- a/libs/python/src/object/function.cpp Wed Sep 12 20:28:47 2007 -0400
+++ b/libs/python/src/object/function.cpp Wed Sep 12 20:39:23 2007 -0400
@@ -539,7 +539,7 @@ void function::add_to_namespace(
_doc += str(reinterpret_cast<const char*>(detail::py_signature_tag));
}
if (doc != 0 && docstring_options::show_user_defined_)
- _doc += doc;
+ _doc += str("\n\n")+doc;
if (docstring_options::show_cpp_signatures_)
{
More information about the Cplusplus-sig
mailing list