Poor formatting of module variables.
Brought to you by:
edloper
(Screenshots attached)
A few cases where module variables are poorly formatted:
1) When formatting a list of strings, rather than
moving the next string onto the next line when the line
length gets too large, a '\' character is just appended
to it, making it look ugly.
2) Tuples are formatted without brackets around them.
(see screenshot, variable "__version__").
3) Code blocks don't appear to preserve spaces (see
screenshot, variable "__version_str__").
By the way - is that meant to be the default behaviour
of Epydoc, to render variables based on the code
written to generate them?
Logged In: YES
user_id=39733
Adding second screenshot.
Logged In: YES
user_id=195958
1) Without this '\' character, the user can't tell if the
line is wrapped, or if there's a newline there. Perhaps
you'd be happier if it used a little icon to indicate the
line wrapping, rather than a brown '\' character?
2) Tuples should now be formatted with parens around them.
3) No, they don't currently preserve spaces -- they are
reformatted to be more compact, because of the limited
space. But the example you gave pointed out a bug: it was
failing to put in spaces that were necessary (between for,
in, etc). This is now fixed.
4) I've gone back and forth on what I want the default
behavior to be, between showing introspected values and
parsed value-generating expressions. Currently, I'm using
introspected values for variable values; but parsed
expressions for default values of function arguments.
E.g., for things like:
def f(x=range(10)): pass
it will display the default value of x as "range(10)"
rather than "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]". But for
variables, it will display the value, as introspected.
Logged In: YES
user_id=195958
I just changed the linewrap marker from a color-coded
backslash to a carriage-return arrow image. Hopefully
this addresses your case (1).
I'm closing this bug, since I believe I've met all your
concerns now, but if you have further suggestions for
improving the formatting of epydoc's output, please submit
a new bug report. Thanks.