title: AttributeError 'Nonetype' object has no attribute. But i check for Nonetype
body: <p>I get <code>AttributeError: 'NoneType' object has no attribute 'rstrip'</code></p>
  <p>So I added <code>if clist is not None:</code> But I keep getting the same error. Why?</p>
  <pre class="lang-py prettyprint-override"><code>if clist is not None:
      result = [
          [name, clist.rstrip()] 
          for name, clist in zip(
              fragments[::group_count+1],
              fragments[group_count::group_count+1]
          )
      ]
  </code></pre>
  <p>Full traceback</p>
  <pre><code>---------------------------------------------------------------------------
  AttributeError                            Traceback (most recent call last)
  Input In [85], in &lt;module&gt;
      120             fragments = fragments[1:]
      121         if clist is not None:
  --&gt; 122             result = [
      123                 [name, clist.rstrip()] 
      124                 for name, clist in zip(
      125                     fragments[::group_count+1],
      126                     fragments[group_count::group_count+1]
      127                 )
      128             ]
  
  Input In [85], in &lt;listcomp&gt;(.0)
      120             fragments = fragments[1:]
      121         if clist is not None:
      122             result = [
  --&gt; 123                 [name, clist.rstrip()] 
      124                 for name, clist in zip(
      125                     fragments[::group_count+1],
      126                     fragments[group_count::group_count+1]
      127                 )
      128             ]
  
  AttributeError: 'NoneType' object has no attribute 'rstrip'
  </code></pre>