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

2017-06-15 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-06-15 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 7a801839e9a88bdcac5aaab494b532230fcf7caa by Mariatta (Jonathan 
Eunice) in branch 'master':
bpo-30620: Remove dead lines from textwrap.dedent (GH-2064)
https://github.com/python/cpython/commit/7a801839e9a88bdcac5aaab494b532230fcf7caa


--
nosy: +Mariatta

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-06-11 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-06-11 Thread Emily Morehouse

Emily Morehouse added the comment:

Jonathan, could you improve the comments for the dedent function? You have a 
great understanding of the logic flow from your proof and it would be 
beneficial to document this to avoid future confusion.

Specifically, it should be clear that Clause 2 inherently handles equivalence 
for margin and indent and that Clause 4 will always complete with the break 
statement.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-06-11 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> emilyemorehouse

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-06-11 Thread Emily Morehouse

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-06-09 Thread Jonathan Eunice

Changes by Jonathan Eunice :


--
pull_requests: +2126

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-06-09 Thread Jonathan Eunice

New submission from Jonathan Eunice:

textwrap.dedent contains a bit of code that appears logical at first blush, but 
in fact can never execute under any input conditions.

Not only are the lines "dead code," they are the only thing (i.e. only 
non-debugging lines) now standing in the way of textwrap having 100% test 
coverage.

Here is the proof: 
https://gist.github.com/jonathaneunice/86f6a721e48c89e272a778530e8f758c

A PR removing the bogus lines is imminent.

--
components: Library (Lib)
messages: 295606
nosy: jonathaneunice
priority: normal
severity: normal
status: open
title: textwrap: dedent contains logic that can never execute
type: enhancement
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com