From 9b1f7541fd2abf91517b92ad477c363c90ff5ecd Mon Sep 17 00:00:00 2001 From: Sebastian Wehling-Benatelli Date: Fri, 30 Oct 2015 06:12:23 +0100 Subject: [PATCH] [added] isSorted function for iterables --- pylot/core/util/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pylot/core/util/utils.py b/pylot/core/util/utils.py index f5c9b5fd..bbfe4d4d 100644 --- a/pylot/core/util/utils.py +++ b/pylot/core/util/utils.py @@ -32,7 +32,8 @@ def runProgram(cmd, parameter=None): output = subprocess.check_output('{} | tee /dev/stderr'.format(cmd), shell = True) - +def isSorted(iterable): + return sorted(iterable) == iterable def fnConstructor(s): if type(s) is str: