What's a more pythonic way generate a new list of lists based on length?
<p>I have a list of lists, and for each list within a list, I want to split it into two lists such that each list's length has a max of 30, otherwise I discard the remainder that can't be fit into 30 and aren't approximately close to 30.</p>

<p>For example: List 1 has a length of 64 -> split it into two lists of 30, 30, and discard the remaining 4.</p>

<p>or List 2 has length of 41, I generate a new list of 30 and discard the 11. </p>

<p>or List 3 has length of 58, I generate two lists of 30 and 28.</p>

<p>I'm using a list splitting function I found: <a href="http://stackoverflow.com/a/1751478/2027556">http://stackoverflow.com/a/1751478/2027556</a></p>

<p>right now my code is something like:</p>

<pre><code>new_list = []
for list_ in cluster:
    if len(list_) &lt; 31 and len(list_) &gt; 24:
       new_list.append(list_)
    elif len(list_) &gt;= 31:
       chunks_list = chunks(list_, 30)
       for item in chunks_list:
          if len(item) &gt; 25:
             new_list.append(item)
</code></pre>

<p>as you can see right now I'm just making a new list and going through the old one, but I think there's a more elegant pythonic solution maybe using list comprehension?</p>
