However, this might be unwanted because the value depends on the platform (and would be different on other platforms), is an object or just should not be relied on to have a certain value.
We introduce a novalue option, that keeps autodoc from value/representation output.
would look like this:
The option to prepend the module (or not) is not touched by this.
The pull-request implements this feature for autodata and autoattribute.
A documentation is also added. Since this is a new feature, this could be in the code for 1.2 the earliest. If it happens later, the documentation needs an update.
No additional tests are included. The test suite runs fine (2.6, 2.7, 3.3, du*).
I did test this in a documentation of mine and it works great. It does what it should and no additional problems are created.
What's missing in this implementation is some type of recursive usage, like giving :novalue: as default or using it in .. automodule::/.. autoclass::.
Enabling the use as a default should work in general (so you don't have to add it to every autodata), but that also won't work with using autoclass. I couldn't find out where the recursiveness of the defaults kick in or why it doesn't.
I got the test system to work (rm -r build helps) and after another fix on my side the test suite runs fine on my pull-request branch.
It's a bit weird that the types for the options mismatch in the tests and in normal usage (util.struct vs autodoc.Options). That makes "novalue" in self.options work normally, but fail in the tests. I use self.option.novalue now.
Thanks for the working on this. It would be nice to have more control over how objects are displayed and I think an having option like this would help.
While looking at your changes here, I got an idea for how to do this and also provide a more general way for displaying attributes. We just need to be able to specify the :annotation: option in the autodoc directives.
I changed to :annotation: and implemented using an argument as the annotation if an argument is given.
I created a SUPPRESS object to distinguish not having the :annotation: option set (-> None) and having no argument for :annotation: (-> SUPPRESS). (see annotation_option())
tox2 runs fine with all versions of Python and Docutils except py25 and pypy (both not installed on my system currently, 1 test is skipped)
I tested the functionality manually. All 3 cases checked for both :autodata: and :autoattribute:.
(running sphinx on a project with a rst file that has these use cases and checking the "dirhtml" output)