Split a string "aabbcc" -> ["aa", "bb", "cc"] without re.split
<p>I would like to split a string according to the title in a single call. I'm looking for a simple syntax using list comprehension, but i don't got it yet:</p>

<pre><code>s = "123456"
</code></pre>

<p>And the result would be:</p>

<pre><code>["12", "34", "56"]
</code></pre>

<p>What i don't want:</p>

<pre><code>re.split('(?i)([0-9a-f]{2})', s)
s[0:2], s[2:4], s[4:6]
[s[i*2:i*2+2] for i in len(s) / 2]
</code></pre>

<p><strong>Edit</strong>:</p>

<p>Ok, i wanted to parse a hex RGB[A] color (and possible other color/component format), to extract all the component.
It seem that the fastest approach would be the last from sven-marnach:</p>

<ol>
<li><p>sven-marnach xrange: 0.883 usec per loop</p>

<pre><code>python -m timeit -s 's="aabbcc";' '[int(s[i:i+2], 16) / 255. for i in xrange(0, len(s), 2)]'
</code></pre></li>
<li><p>pair/iter: 1.38 usec per loop</p>

<pre><code>python -m timeit -s 's="aabbcc"' '["%c%c" % pair for pair in zip(* 2 * [iter(s)])]'
</code></pre></li>
<li><p>Regex: 2.55 usec per loop</p>

<pre><code>python -m timeit -s 'import re; s="aabbcc"; c=re.compile("(?i)([0-9a-f]{2})"); 
split=re.split' '[int(x, 16) / 255. for x in split(c, s) if x != ""]'
</code></pre></li>
</ol>
