Re: [ansible-project] Ternary filter vs conditional expressions
Thanks Brian, If people find the filter useful then that's fair enough. Everybody has a difference preference. I probably suffer from Python's "There should be one -- and preferably only one -- obvious way to do it." On Thu, Apr 12, 2018 at 9:25 PM, Brian Coca wrote: > Other people found it confusing and wanted something they could easily > lookup up, like a filter. > > Once I added it, I stopped hearing complaints, so not sure how much > that is worth other than anecdotal evidence. > > Use whichever way suits you best. > > > > > > -- > -- > Brian Coca > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Ansible Project" group. > To unsubscribe from this topic, visit https://groups.google.com/d/ > topic/ansible-project/mi8zuVlRR3g/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > ansible-project+unsubscr...@googlegroups.com. > To post to this group, send email to ansible-project@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/ansible-project/CACVha7cA6WoFgc7jOBcvwzr6nhpyA > _uhBO3GoVfw%3Df0ys9%2BvGw%40mail.gmail.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAPA8sOJ7d9Fg1bDzT3kZLB-Dg%2B4GdU1gpTC%3DngLUT9bOu8uuog%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] Ternary filter vs conditional expressions
Other people found it confusing and wanted something they could easily lookup up, like a filter. Once I added it, I stopped hearing complaints, so not sure how much that is worth other than anecdotal evidence. Use whichever way suits you best. -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CACVha7cA6WoFgc7jOBcvwzr6nhpyA_uhBO3GoVfw%3Df0ys9%2BvGw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] Ternary filter vs conditional expressions
On Wednesday, April 11, 2018 at 3:10:34 PM UTC+1, Brian Coca wrote: > > > The `ternary` filter is easier for people that are not familiar with > Python, but non programmers and those used to ternary structures in > other languages. > > I'm used to the different ternary structures from different programming languages and I find it hard to believe that the ternary filter is easier for non programmers. Is there any evidence of it being the case? The python style syntax reads more like English and you can immediately see the control flow. On the other hand, the first time I've seen the ternary filter I had to look up how it works. Is the first argument for the false or for the true condition. You don't have this problem with the other syntax. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/0d31cef3-a3a7-4c31-8018-6cc5f0c3d7c4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] Ternary filter vs conditional expressions
Even though Ansible is written in Python, Python devs are not the main target of the tool, so being 'pythonic' is not really an aim of it. The `ternary` filter is easier for people that are not familiar with Python, but non programmers and those used to ternary structures in other languages. -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CACVha7e7zDsPgtm8xrwKwZ9GQj808gqLMbx6kRo0b_o1DMG1gQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.