Opened 22 years ago

Closed 13 years ago

#918 closed Feature Requests (invalid)

__doc__ strings

Reported by: ericvrp@… Owned by: Dave Abrahams
Milestone: Boost 1.36.0 Component: python USE GITHUB
Version: Boost 1.34.0 Severity: Problem
Keywords: Cc: ericvrp@…

Description (last modified by Dave Abrahams)

For most Python modules and packages html documentation can be generated automatically by a tool that is included in python 2.1 . Being able to set the docstring would be a step in the right direction to make boost.python compatible with pydoc.py .

Attachments (1)

function-docstrings.tgz (4.3 KB ) - added by Dave Abrahams 15 years ago.
Partially-completed work on function docstrings

Download all attachments as: .zip

Change History (7)

comment:1 by blais, 21 years ago

Logged In: YES 
user_id=10996

I am already able to set the docstring with the following
bit of code in the module initialization:

module.add( boost::python::make_ref( help() ), "__doc__");

where help() is a function that returns a string.

Is there a way to set docstrings of functions though?

comment:2 by david_abrahams, 21 years ago

Logged In: YES 
user_id=52572

At present, I don't think there is.
You would need to modify all of Boost.Python's function 
classes to hold a doc string, and modify all of the def() 
functions to accept an optional doc string. I started this 
project, but realized that I was crazy after having stayed 
up for 36 hours straight working on Thursday and Friday. If 
you're interested in the broken state of the source, it's 
attached here.

If you get it to work, please submit a patch for the 
completed code.

Thanks,
Dave

comment:3 by Dave Abrahams, 15 years ago

Description: modified (diff)
Owner: changed from david_abrahams to Dave Abrahams
Severity: Showstopper
Status: assignednew

comment:4 by Dave Abrahams, 15 years ago

Description: modified (diff)
Milestone: Boost 1.35.0
Reporter: changed from ericvrp to ericvrp@…
Status: newassigned
Version: Nonerelease 1.34.0

by Dave Abrahams, 15 years ago

Attachment: function-docstrings.tgz added

Partially-completed work on function docstrings

comment:5 by Dave Abrahams, 15 years ago

Severity: ShowstopperProblem

I think now that we have Boost.Parameter this job could become much easier.

comment:6 by Dave Abrahams, 13 years ago

Cc: ericvrp@… added
Resolution: Noneinvalid
Status: assignedclosed

Sorry it's been so long, but I'm confused about exactly what's missing here. It looks to me like the def() functions already support supplying a docstring. If there's still a real problem, please reopen this bug. In the meantime, I'm closing it.

Note: See TracTickets for help on using tickets.