On Wed, Oct 23, 2019 at 01:42:11PM +0300, Serhiy Storchaka wrote:
> 23.10.19 13:08, Steven D'Aprano пише:
> >But the advantage of changing the syntax is that it becomes the One
> >Obvious Way, and you know it will be efficient whatever version or
> >implementation of Python you are using.
>
> There is already the One Obvious Way, and you know it will work whatever
> version or implementation of Python you are using.
Your "One Obvious Way" is not obvious to me. Should I write this:
# This is from actual code I have used.
["zero", "one", "two", "three", "four", "five", "six", "seven",
"eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen",
"fifteen", "sixteen", "seventeen", "eighteen", "nineteen",
"twenty", "twenty-one", "twenty-two", "twenty-three", "twenty-four"
"twenty-five", "twenty-six", "twenty-seven", "twenty-eight",
"twenty-nine", "thirty"]
Or this?
"""zero one two three four five six seven eight nine ten eleven
twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen
twenty twenty-one twenty-two twenty-three twenty-four twenty-five
twenty-six twenty-seven twenty-eight twenty-nine thirty""".split()
I've been told by people that if I use the first style I'm obviously
ignorant and don't know Python very well, and by other people that the
second one is a hack and that I would fail a code review for using it.
So please do educate me Serhiy, which one is the One Obvious Way that we
should all agree is the right thing to do?
--
Steven
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/ZM3O3BF7C6A5Y6NF3LKJNAN2WDXQMLTY/
Code of Conduct: http://python.org/psf/codeofconduct/