[issue30620] textwrap: dedent contains logic that can never execute

Emily Morehouse report at bugs.python.org
Sun Jun 11 17:36:44 EDT 2017


Emily Morehouse added the comment:

The logic in your proof is certainly sound. The only time that the else statement within Clause 4 (to use terminology from the proof) would execute is either 
  1) if margin is equal to indent, which is handled in Clause 2, or 
  2) if the margin is None, which is handled in Clause 1.

I support this PR. On a related note, I feel that the existing comments could clearer illustrate this. Specifically, it is unclear that Clause 2 will also catch cases where margin and indent are equal.

----------
nosy: +emilyemorehouse

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


More information about the Python-bugs-list mailing list