[docs] Doc: remove errors about mixed-type comparisons. (issue 12067)

vadmium+py at gmail.com vadmium+py at gmail.com
Wed Aug 27 07:56:54 CEST 2014


Some comments on the doc changes


https://bugs.python.org/review/12067/diff/12409/Doc/reference/expressions.rst
File Doc/reference/expressions.rst (right):

https://bugs.python.org/review/12067/diff/12409/Doc/reference/expressions.rst#newcode1087
Doc/reference/expressions.rst:1087: The behavior of the default equality
comparison that instances with different
Needs a comma between “comparison, that”

https://bugs.python.org/review/12067/diff/12409/Doc/reference/expressions.rst#newcode1096
Doc/reference/expressions.rst:1096: otherwise, :exc:`TypeError` is
raised:
Everything is an instance of the built-in type “object”, and “subtypes
of each other” does not make much sense to me. I think the cases where
TypeError is raised or not by default are already described above. Would
it hurt to just drop the second sentence?

https://bugs.python.org/review/12067/diff/12409/Doc/reference/expressions.rst#newcode1149
Doc/reference/expressions.rst:1149: each other), have the same length,
and each pair of corresponding elements
Again, “subtypes of each other” does not make sense. Maybe just say you
cannot compare between lists, tuples, and ranges [and byte sequences and
text strings] this way. [I understand comparing the different kinds of
byte sequences is meant to work though.]

https://bugs.python.org/review/12067/diff/12409/Doc/reference/expressions.rst#newcode1156
Doc/reference/expressions.rst:1156: * Mappings (instances of
:class:`dict`) are compared lexicographically using
Not sure “lexicographical comparison” makes sense unless the items have
an order. Maybe the original wording was better?

https://bugs.python.org/review/12067/diff/12409/Doc/reference/expressions.rst#newcode1216
Doc/reference/expressions.rst:1216: sequences and mappings, but not to
sets). See also the
Perhaps drop “mappings”; even OrderedDict does not do ordering
comparisons for me

https://bugs.python.org/review/12067/


More information about the docs mailing list