> > Inheritance diagrams don't work for me (they just don't
> > produce anything), and this is a nice way to show it somehow (I will
> > bug you with inheritance diagrams separately, as I try it out more; I
> > suspect (again) boost::python vs. pure python classes.)
>
> Quite possible :(
>
> That said, if you find out an easy way to determine if an object is a
> boost::python class (and if a function is a boost::python function,
> from the other thread), let me know and I'll add it to autodoc.

Trying with current hg sphinx-domains (which worked out of the box
without any changes in config files -- nice surprise):

inheritance diagram for some reason tries to pickle the objects (error
below), which doesn't work on boost::python classes (unless they
specifically support it). Is there a real reason for pickling/
unpickling?

To recognize boost::python functions, I use
obj.__repr__().startwith('<Boost.Python.function object at 0x'), but I
don't think that is the most proper way.

For classes, you can ask for __class__ attribute of the type itself,
e.g. (CpmMat is a boost::python class):

>>> str(CpmMat.__class__)
"<type 'Boost.Python.class'>"
>>> str(CpmMat().__class__)
"<class 'yade.wrapper.CpmMat'>"
>>> str(CpmMat().__class__.__class__)
"<type 'Boost.Python.class'>"

but getting and checking that string is not the most straightforward
either. inspect.getsource(CpmMat) will fail with IOError, which could
also be an indicator of non-python class.

Cheers, Vaclav

---

Exception occurred:
  File "/usr/local/lib/python2.6/dist-packages/
Sphinx-1.0pre_ca32188af3b7dev_20100304-py2.6.egg/sphinx/
environment.py", line 704, in read_doc
    pickle.dump(doctree, f, pickle.HIGHEST_PROTOCOL)
PicklingError: Can't pickle <type 'Boost.Python.instance'>: import of
module Boost.Python failed
The full traceback has been saved in /tmp/sphinx-err-wc371H.log, if
you want to report the issue to the developers

$ cat /tmp/sphinx-err-wc371H.log

# Sphinx version: 1.0pre
# Docutils version: 0.6 release
# Jinja2 version: 2.3.1
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/
Sphinx-1.0pre_ca32188af3b7dev_20100304-py2.6.egg/sphinx/cmdline.py",
line 173, in main
    app.build(force_all, filenames)
  File "/usr/local/lib/python2.6/dist-packages/
Sphinx-1.0pre_ca32188af3b7dev_20100304-py2.6.egg/sphinx/
application.py", line 201, in build
    self.builder.build_all()
  File "/usr/local/lib/python2.6/dist-packages/
Sphinx-1.0pre_ca32188af3b7dev_20100304-py2.6.egg/sphinx/builders/
__init__.py", line 161, in build_all
    self.build(None, summary='all source files', method='all')
  File "/usr/local/lib/python2.6/dist-packages/
Sphinx-1.0pre_ca32188af3b7dev_20100304-py2.6.egg/sphinx/builders/
__init__.py", line 218, in build
    purple, length):
  File "/usr/local/lib/python2.6/dist-packages/
Sphinx-1.0pre_ca32188af3b7dev_20100304-py2.6.egg/sphinx/builders/
__init__.py", line 120, in status_iterator
    for item in iterable:
  File "/usr/local/lib/python2.6/dist-packages/
Sphinx-1.0pre_ca32188af3b7dev_20100304-py2.6.egg/sphinx/
environment.py", line 519, in update_generator
    self.read_doc(docname, app=app)
  File "/usr/local/lib/python2.6/dist-packages/
Sphinx-1.0pre_ca32188af3b7dev_20100304-py2.6.egg/sphinx/
environment.py", line 704, in read_doc
    pickle.dump(doctree, f, pickle.HIGHEST_PROTOCOL)
PicklingError: Can't pickle <type 'Boost.Python.instance'>: import of
module Boost.Python failed

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en.

Reply via email to