#74 Poor formatting of module variables.


(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?


  • Allan Crooks

    Allan Crooks - 2006-03-17

    Logged In: YES

    Adding second screenshot.

  • Edward Loper

    Edward Loper - 2006-08-21
    • priority: 5 --> 4
  • Edward Loper

    Edward Loper - 2006-08-21

    Logged In: YES

    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.

  • Edward Loper

    Edward Loper - 2006-08-22

    Logged In: YES

    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.

  • Edward Loper

    Edward Loper - 2006-08-22
    • status: open --> closed-fixed

Log in to post a comment.