One big problem with the current obvious way would be shared by the proposal. This hits me fairly often.
colors1 = "red green blue".split() # happy Later colors2 = "cyan forest green burnt umber".split() # oops, not what I wanted, quote each separately On Wed, Oct 23, 2019, 7:03 AM Steven D'Aprano <st...@pearwood.info> wrote: > 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 -- 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/ZM3O3BF7C6A5Y6NF3LKJNAN2WDXQMLTY/ > Code of Conduct: http://python.org/psf/codeofconduct/ >
_______________________________________________ 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/NHRHYL5JUO7BNR3ZAHEBSTIZA5FZ5ORG/ Code of Conduct: http://python.org/psf/codeofconduct/