diff options
author | Eevee (Alex Munroe) <eevee.git@veekun.com> | 2013-08-27 15:25:16 -0700 |
---|---|---|
committer | Eevee (Alex Munroe) <eevee.git@veekun.com> | 2013-08-27 15:25:16 -0700 |
commit | 371a47d9b05ee58bfb97e8324b3337280199d674 (patch) | |
tree | 958515bd67b87613aa24ec6707cc31beacd4ee4a | |
parent | 0773b2c16c9d15f2dc76f7a4d49e98c1e5f59ea2 (diff) | |
download | pyscss-371a47d9b05ee58bfb97e8324b3337280199d674.tar.gz |
Implement zip().
-rw-r--r-- | scss/functions/core.py | 7 | ||||
-rw-r--r-- | scss/tests/functions/test_core.py | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/scss/functions/core.py b/scss/functions/core.py index 93f0d8b..8881457 100644 --- a/scss/functions/core.py +++ b/scss/functions/core.py @@ -586,6 +586,13 @@ def index(lst, val): return Boolean(False) +@register('zip') +def zip_(*lists): + return List( + [List(zipped) for zipped in zip(*lists)], + use_comma=True) + + # ------------------------------------------------------------------------------ # Map functions diff --git a/scss/tests/functions/test_core.py b/scss/tests/functions/test_core.py index 6d727a9..cf0198b 100644 --- a/scss/tests/functions/test_core.py +++ b/scss/tests/functions/test_core.py @@ -321,7 +321,6 @@ def test_append(calc): assert calc('append((blue, red), green, space)') == calc('blue red green') -@xfail(reason="not implemented (oops)") def test_zip(calc): # Examples from the Ruby docs assert calc('zip(1px 1px 3px, solid dashed solid, red green blue)') == calc('1px solid red, 1px dashed green, 3px solid blue') |