Re: [Epydoc-devel] Planning for 3.0
Brought to you by:
edloper
From: Edward L. <ed...@gr...> - 2007-02-13 20:54:42
|
Daniele brought up the issue of improving epydoc's pretty-printing of object values. As of svn revision 1477, I've made most of the improvements that were suggested. In particular: * I refactored the pyval_repr() code, so that now syntax-highlighting is done in a central place (epydoc.markup.pyval_repr), and doesn't need to be repeated for each output format. In particular, APIDoc.pyval_repr() now returns a subclass of ParsedEpydocDocstring. * The new code does pretty-printing of lists, dicts, strings, tuples, sets, frozensets, and regexp objects. This pretty-printing should be faster than using the pprint module, in that it short-circuits as soon as the the output contains max_lines lines. It also does automatic line-wrapping. * str() is used instead of repr() for floats, ints, longs, and complex numbers. Other types could be added to this list, if desired. * When the pretty-printed representation is constructed, a score is calculated that evaluates "how useful" the representation is. If it's too low, then the parse-based representation is used instead (assuming it's available). In particular, if the string returned by an object's __repr__ has the form <.* at 0xaddr>, then epydoc will tend to use the parse-based repr instead. -Edward |