for / while else doesn't make sense

Ian Kelly ian.g.kelly at gmail.com
Tue Jun 7 19:11:19 EDT 2016


On Tue, Jun 7, 2016 at 3:58 PM, Lawrence D’Oliveiro
<lawrencedo99 at gmail.com> wrote:
> On Tuesday, June 7, 2016 at 11:53:46 PM UTC+12, Ian wrote:
>> On Tue, Jun 7, 2016 at 1:52 AM, Lawrence D’Oliveiro wrote:
>
>>> Wow, that’s only twice the length of the code you’re replacing. Well done.
>>
>> Huh? The example that you posted was 17 lines, excluding comments. My
>> replacement code is 17 lines, excluding comments. Where are you
>> getting "twice the length" from?
>
> Maybe not twice. But your code for dealing with the include stack was 16 lines, as opposed to 13 in mine.

Well, I don't know how you're counting that. All the code for dealing
with the include stack is in the generate_lines function, which is 10
lines long. The remaining code is then simpler for not having to deal
with it. In the original version, I can't identify which lines are
"dealing with the include stack" because they're so intertwined. For
example, all the sporadic code checking for line == None or line !=
None only need to exist because of the include stack.



More information about the Python-list mailing list