Initialize arbitrarily shaped nested list
<p>I'm trying to implement a function that initializes an arbitrarily sized list with objects, similar to how numpy array initialization methods work.</p>

<pre><code>def fill(shape, object):
</code></pre>

<p>I've been banging my head against this but can't think of a way to do this for arbitrary length dimensionality. I'm guessing it will require recursion of some sort.</p>

<p>Here is an example of the desired behavior. For simplicity the object is just the floating-point number 0, but I need this to work with any class:</p>

<pre><code>&gt; fill( (2, 3, 4), 0.)
[
 [[ 0.,  0.,  0.,  0.],
  [ 0.,  0.,  0.,  0.],
  [ 0.,  0.,  0.,  0.]]
,
 [[ 0.,  0.,  0.,  0.],
  [ 0.,  0.,  0.,  0.],
  [ 0.,  0.,  0.,  0.]]
]
</code></pre>
