title: selectattr returns generator rows and cannot use results as a dict
body: <p>SOLUTION:
  I Don't know what is the exact difference between <code>python -m pip install ansible</code>  or <code>apt install ansible</code> but when I installed <code>python -m pip ansible-core==2.10.4</code> it works fine.</p>
  <hr />
  <p>I have CSV file which looks like:</p>
  <pre><code>id;env;credentials;path
  1;tst;userA;/tmpA
  2;dev;userB;/tmpB
  3;dev;userB;/tmpC
  4;acc;userB;/tmpD
  5;prd;userC;/tmpE
  </code></pre>
  <p>I read this file using <code>read_csv</code> module and then I'm filtering using <code>selectattr</code>:</p>
  <pre class="lang-yaml prettyprint-override"><code>  - name: Read CSV
      read_csv:
        path: &quot;/tmp/example.csv&quot;
        delimiter: ';'
      register: csv_output
  
    - name: Filter rows
      set_fact:
        new_fact: &quot;{{ csv_output.list | selectattr('env', 'equalto', tst) }}&quot;
  </code></pre>
  <p>In the past I was able to just use these results as a dict so for example:</p>
  <pre class="lang-yaml prettyprint-override"><code>- debug:
      msg: &quot;{{ new_fact }}&quot;
  
  ok: [ansible_main] =&gt; {
      &quot;msg&quot;: [
          {
              &quot;id&quot;: &quot;1&quot;,
              &quot;env&quot;: &quot;tst&quot;,
              &quot;credentials&quot;: &quot;userA&quot;,
              &quot;path&quot;: &quot;/tmpA&quot;
          }
      ]
  }
  </code></pre>
  <p>but when I try to print <code>new_fact</code> on my local machine I see only generator:</p>
  <pre><code>ok: [ansible_main] =&gt; {
      &quot;msg&quot;: &quot;&lt;generator object select_or_reject at 0x7f2e4e8847b0&gt;&quot;
  }
  </code></pre>
  <p>and I cannot use <code>new_fact.credentials</code> variable... Do you know how can I fix it? I know I can add <code>| list</code> at the end of my filter but then I also cannot use <code>new_fact.credentials</code></p>
  <p>Details of my installation:</p>
  <pre><code>ansible 2.9.6
    config file = /etc/ansible/ansible.cfg
    configured module search path = ['/home/userA/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
    ansible python module location = /usr/lib/python3/dist-packages/ansible
    executable location = /usr/bin/ansible
    python version = 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0]
  </code></pre>