What's wrong with my Python code? I'm trying to deep-reverse a list input
<pre><code>def is_list(p):

    return isinstance(p, list)


def deep_reverse(list):

    o=[]
    for i in reversed(list):

        if is_list(i)==True:
            print i
            deep_reverse(i)

        o.append(i)

    return o
</code></pre>

<p>For example:</p>

<pre><code>p = [1, [2, 3, [4, [5, 6]]]]
print deep_reverse(p)
#&gt;&gt;&gt; [[[[6, 5], 4], 3, 2], 1]
</code></pre>
