title: What is an efficient container for a single reference?
body: <p>I have a list containing arbitrary objects of uniform type:</p>
  
  <pre><code>items = ['a', 'b', 'c', 'x', 'y', 'z']
  </code></pre>
  
  <p>I'm scanning through the list and marking the objects by placing them in a container based on some unimportant condition. Let's say it's odd indices:</p>
  
  <pre><code>for i in range(len(items)):
      if i % 2:
          items[i] = (items[i],)
  </code></pre>
  
  <p>A second pass will filter the list to unwrap the flagged items and remove everything else:</p>
  
  <pre><code>items = [x[0] for x in items if isinstance(x, tuple)]
  </code></pre>
  
  <p>This code is fundamentally functional. However, for very large arrays, the flagging is increasing memory usage and naturally taking time.</p>
  
  <p>What is the most efficient container to use for something like this? I'm using tuple because it has the smallest footprint of all the container classes I looked at. Is there a better way to wrap a single reference?</p>