On Fri, 28 Aug 2020 at 13:26, David Mertz <me...@gnosis.cx> wrote: > As a side note, I don't really get why everyone else thinks a try/except is > the most natural approach while a ternary seems more obvious to me for this > situation. But it kinda connects to me liking list.get() better, I think... > since "not enough items" doesn't seem as *exceptional* to me as it apparently > does to some others.
Possibly because in reality, people very rarely write code like that, so they are working out what they'd use "from scratch", rather than just quoting a well-known idiom that they are familiar with? Which to me says that this method isn't nearly as useful in practice as some people are claiming. Paul _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/6QPYCQHLKJ7TED4CLBWVDCKDB64QFNMM/ Code of Conduct: http://python.org/psf/codeofconduct/