# selectattr() returns everything when attribute is 'update'?

**URL:** <https://forum.ansible.com/t/selectattr-returns-everything-when-attribute-is-update/30808>\
**Category:** Ansible Project\
**Created:** [July 18, 2019, 1:32pm UTC](https://forum.ansible.com/t/selectattr-returns-everything-when-attribute-is-update/30808 "2019-07-18T13:32:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [July 18, 2019, 1:32pm UTC](https://forum.ansible.com/t/selectattr-returns-everything-when-attribute-is-update/30808/1 "2019-07-18T13:32:32Z")

</div>

Hi

I'm seeing some weird behaviour trying to use selectattr() on a list  
of dicts, when the attribute name I am using is the literal string  
'update'.  
Anything else works fine.

Example playbook:

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [July 18, 2019, 1:45pm UTC](https://forum.ansible.com/t/selectattr-returns-everything-when-attribute-is-update/30808/2 "2019-07-18T13:45:56Z")

</div>

I think this is because 'update' is a reserved word:

[https://docs.ansible.com/ansible/latest/user\_guide/playbooks\_variables.html#creating-valid-variable-names](https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#creating-valid-variable-names)

I'm seeing the same behavior with 'pop' for instance (though not with  
many others).

Dick

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [July 27, 2019, 3:19pm UTC](https://forum.ansible.com/t/selectattr-returns-everything-when-attribute-is-update/30808/3 "2019-07-27T15:19:33Z")

</div>

I would consider this a bug, since returning data when query REST API could be anything and Ansible need to handle that.
