mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
added more reasons to avoid dot notation (#43724)
This commit is contained in:
parent
005233f814
commit
cbd54a4b2c
1 changed files with 7 additions and 0 deletions
|
@ -466,6 +466,13 @@ for a list of the known public attributes.
|
|||
|
||||
Also array notation allows for dynamic variable composition, see dynamic_variables_.
|
||||
|
||||
Another problem with 'dot notation' is that some keys can cause problems because they collide with attributes and methods of python dictionaries.
|
||||
|
||||
.. code-block:: jinja
|
||||
|
||||
item.update # this breaks if item is a dictionary, as 'update()' is a python method for dictionaries
|
||||
item['update'] # this works
|
||||
|
||||
|
||||
.. _argsplat_unsafe:
|
||||
|
||||
|
|
Loading…
Reference in a new issue