From 3b4eddaf0a3421153be12735d19030604952fd7f Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 20 Feb 2014 07:57:22 +0100 Subject: m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/argparser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/argparser.py b/src/argparser.py index 92fe798..f9160da 100644 --- a/src/argparser.py +++ b/src/argparser.py @@ -86,7 +86,7 @@ class ArgParser(): ''' Gets the standard abbrevation expender - @return :(opt:str, opts:list, mapping:dict?=None)→str? The standard abbrevation expender + @return :(opt:str, opts:list, mapping:dict)→str? The standard abbrevation expender ''' def uniq(items): if len(items) < 2: @@ -99,9 +99,9 @@ class ArgParser(): return rc one = lambda arg : arg[0] if len(arg) == 1 else None lfilter = lambda f, l : list(filter(f, l)) - map_ = lambda mapping, args : args if mapping is None else [mapping[a] for a in args] + map_ = lambda mapping, args : [mapping[a] for a in args] test = lambda arg : lambda a : a.startswith(arg) - return lambda arg, candidates, mapping = None : one(uniq(map_(mapping, lfilter(test(arg), candidates)))) + return lambda arg, candidates, mapping : one(uniq(map_(mapping, lfilter(test(arg), candidates)))) @staticmethod -- cgit v1.2.3-70-g09d2