[New-bugs-announce] [issue22539] Table formatting errors in pydoc

Artur de Sousa Rocha report at bugs.python.org
Thu Oct 2 13:38:30 CEST 2014


New submission from Artur de Sousa Rocha:

Tables in pydoc are formatted incorrectly -- some lines are missing. Example in Python 3.4.1:

>>> help('TUPLES')
...
+----------------------------+----------------------------------+------------+
| Operation                  | Result                           | Notes      |
+============================+==================================+============+
| "x in s"                   | "True" if an item of *s* is      | (1)        |
+----------------------------+----------------------------------+------------+
| "x not in s"               | "False" if an item of *s* is     | (1)        |
+----------------------------+----------------------------------+------------+
| "s + t"                    | the concatenation of *s* and *t* | (6)(7)     |
+----------------------------+----------------------------------+------------+
| "s * n" or "n * s"         | *n* shallow copies of *s*        | (2)(7)     |
+----------------------------+----------------------------------+------------+
| "s[i]"                     | *i*th item of *s*, origin 0      | (3)        |
+----------------------------+----------------------------------+------------+
| "s[i:j]"                   | slice of *s* from *i* to *j*     | (3)(4)     |
+----------------------------+----------------------------------+------------+
| "s[i:j:k]"                 | slice of *s* from *i* to *j*     | (3)(5)     |
+----------------------------+----------------------------------+------------+
+----------------------------+----------------------------------+------------+
+----------------------------+----------------------------------+------------+
+----------------------------+----------------------------------+------------+
| "s.index(x[, i[, j]])"     | index of the first occurrence of | (8)        |
+----------------------------+----------------------------------+------------+
+----------------------------+----------------------------------+------------+


Older version of the same table in Python 3.2.5 in Cygwin console:

+--------------------+----------------------------------+------------+
| Operation          | Result                           | Notes      |
+====================+==================================+============+
| ``x in s``         | ``True`` if an item of *s* is    | (1)        |
|                    | equal to *x*, else ``False``     |            |
+--------------------+----------------------------------+------------+
| ``x not in s``     | ``False`` if an item of *s* is   | (1)        |
|                    | equal to *x*, else ``True``      |            |
+--------------------+----------------------------------+------------+
| ``s + t``          | the concatenation of *s* and *t* | (6)        |
+--------------------+----------------------------------+------------+
| ``s * n, n * s``   | *n* shallow copies of *s*        | (2)        |
|                    | concatenated                     |            |
+--------------------+----------------------------------+------------+
| ``s[i]``           | *i*th item of *s*, origin 0      | (3)        |
+--------------------+----------------------------------+------------+
| ``s[i:j]``         | slice of *s* from *i* to *j*     | (3)(4)     |
+--------------------+----------------------------------+------------+
| ``s[i:j:k]``       | slice of *s* from *i* to *j*     | (3)(5)     |
|                    | with step *k*                    |            |
+--------------------+----------------------------------+------------+
| ``len(s)``         | length of *s*                    |            |
+--------------------+----------------------------------+------------+
| ``min(s)``         | smallest item of *s*             |            |
+--------------------+----------------------------------+------------+
| ``max(s)``         | largest item of *s*              |            |
+--------------------+----------------------------------+------------+
| ``s.index(i)``     | index of the first occurence of  |            |
|                    | *i* in *s*                       |            |
+--------------------+----------------------------------+------------+
| ``s.count(i)``     | total number of occurences of    |            |
|                    | *i* in *s*                       |            |
+--------------------+----------------------------------+------------+

----------
assignee: docs at python
components: Documentation
messages: 228217
nosy: Artur.de.Sousa.Rocha, docs at python
priority: normal
severity: normal
status: open
title: Table formatting errors in pydoc
type: behavior
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22539>
_______________________________________


More information about the New-bugs-announce mailing list