diff options
author | Jan Pokorný <jpokorny@redhat.com> | 2014-11-14 13:25:26 +0100 |
---|---|---|
committer | Jan Pokorný <jpokorny@redhat.com> | 2014-11-14 22:11:21 +0100 |
commit | 3a3eac0097598bdaad18e081f0359d905f24fed5 (patch) | |
tree | 957c69cfec55661eedf56fc0e9f2fa541a39d4af /utils.py | |
parent | 904116553df1ac3d3ef5ecc88df33d04be29cf50 (diff) | |
download | clufter-3a3eac0097598bdaad18e081f0359d905f24fed5.tar.gz clufter-3a3eac0097598bdaad18e081f0359d905f24fed5.tar.xz clufter-3a3eac0097598bdaad18e081f0359d905f24fed5.zip |
utils: arg2wrapped: make sure list on input is on output
Previously, the list was deconstructed and reconstructed as a tuple.
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'utils.py')
-rw-r--r-- | utils.py | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -15,8 +15,9 @@ tuplist = lambda x: isinstance(x, (tuple, list, set)) # turn args into tuple unless single tuplist arg args2sgpl = \ lambda x=(), *y: x if not y and tuplist(x) else (x, ) + y -args2combsgpl = arg2wrapped = \ - lambda x=(), *y: x if not y and tuplist(x) and len(x) > 1 else (x, ) + y +arg2wrapped = \ + lambda x=(), *y: \ + x if not y and isinstance(x, tuple) and len(x) > 1 else (x, ) + y args2unwrapped = \ lambda x=None, *y: x if not y else (x, ) + y # turn args into tuple unconditionally |