[Python-checkins] r42135 - sandbox/trunk/pycon/parse-sched.py

Jim Jewett jimjjewett at gmail.com
Mon Jan 23 16:56:55 CET 2006


Am I missing something, or is the second "span < len(time_list)" redundant?

On 1/21/06, andrew.kuchling <python-checkins at python.org> wrote:
> Author: andrew.kuchling
> Date: Sat Jan 21 15:14:16 2006
> New Revision: 42135
>
> Modified:
>    sandbox/trunk/pycon/parse-sched.py
> Log:
> Change #! line; fix bug in determining row span (code would walk off the end of the list)
>
> Modified: sandbox/trunk/pycon/parse-sched.py
> ==============================================================================
> --- sandbox/trunk/pycon/parse-sched.py  (original)
> +++ sandbox/trunk/pycon/parse-sched.py  Sat Jan 21 15:14:16 2006
> @@ -1,4 +1,4 @@
> -#!/usr/bin/python
> +#!/usr/bin/env python
>
>  # Reads a page with a wiki-format table
>
> @@ -93,8 +93,11 @@
>      if len(time_list) == 0:
>          return 1
>      span = 0
> -    while (time_list[span][0] < end_time and span < len(time_list)):
> +    while (span < len(time_list) and
> +          (time_list[span][0] < end_time and span < len(time_list))):
>          span += 1
> +    if span == len(time_list):
> +        return 1
>      return span+1
>
>
> _______________________________________________
> Python-checkins mailing list
> Python-checkins at python.org
> http://mail.python.org/mailman/listinfo/python-checkins
>


More information about the Python-checkins mailing list