Lichen

Changeset

421:adff136b5f08
2016-12-16 Paul Boddie raw files shortlog changelog graph Moved _max and _min into the span module.
lib/__builtins__/dict.py (file) lib/__builtins__/sequence.py (file) lib/__builtins__/span.py (file)
     1.1 --- a/lib/__builtins__/dict.py	Fri Dec 16 16:48:15 2016 +0100
     1.2 +++ b/lib/__builtins__/dict.py	Fri Dec 16 18:07:58 2016 +0100
     1.3 @@ -20,7 +20,7 @@
     1.4  """
     1.5  
     1.6  from __builtins__.iterator import itemiterator
     1.7 -from __builtins__.sequence import _max
     1.8 +from __builtins__.span import _max
     1.9  from native import isinstance as _isinstance
    1.10  
    1.11  class dict:
     2.1 --- a/lib/__builtins__/sequence.py	Fri Dec 16 16:48:15 2016 +0100
     2.2 +++ b/lib/__builtins__/sequence.py	Fri Dec 16 18:07:58 2016 +0100
     2.3 @@ -267,22 +267,4 @@
     2.4      else:
     2.5          return index
     2.6  
     2.7 -def _max(x, y):
     2.8 -
     2.9 -    "Return the maximum of 'x' and 'y'."
    2.10 -
    2.11 -    if x >= y:
    2.12 -        return x
    2.13 -    else:
    2.14 -        return y
    2.15 -
    2.16 -def _min(x, y):
    2.17 -
    2.18 -    "Return the minimum of 'x' and 'y'."
    2.19 -
    2.20 -    if x <= y:
    2.21 -        return x
    2.22 -    else:
    2.23 -        return y
    2.24 -
    2.25  # vim: tabstop=4 expandtab shiftwidth=4
     3.1 --- a/lib/__builtins__/span.py	Fri Dec 16 16:48:15 2016 +0100
     3.2 +++ b/lib/__builtins__/span.py	Fri Dec 16 18:07:58 2016 +0100
     3.3 @@ -19,8 +19,6 @@
     3.4  this program.  If not, see <http://www.gnu.org/licenses/>.
     3.5  """
     3.6  
     3.7 -from __builtins__.sequence import _max, _min
     3.8 -
     3.9  class slice:
    3.10  
    3.11      "Implementation of slice."
    3.12 @@ -113,4 +111,22 @@
    3.13  
    3.14      return list(xrange(start_or_end, end, step))
    3.15  
    3.16 +def _max(x, y):
    3.17 +
    3.18 +    "Return the maximum of 'x' and 'y'."
    3.19 +
    3.20 +    if x >= y:
    3.21 +        return x
    3.22 +    else:
    3.23 +        return y
    3.24 +
    3.25 +def _min(x, y):
    3.26 +
    3.27 +    "Return the minimum of 'x' and 'y'."
    3.28 +
    3.29 +    if x <= y:
    3.30 +        return x
    3.31 +    else:
    3.32 +        return y
    3.33 +
    3.34  # vim: tabstop=4 expandtab shiftwidth=4