On Wed, Oct 23, 2019 at 06:01:06PM +0100, Rhodri James wrote:
> The proposed:
>
> %w[red green blue]
>
> says that this is something, good luck figuring out what.
You don't need *luck* to figure out what it does, you need five seconds
in the REPL.
One of the most annoying tendencies on this mailing list is for people
who dislike a feature to play dumb.
"I know decorators, threads, multiprocessing and unicode, classes
and metaclasses, protocols from ftp to smtp and beyond, I am fluent
in Python, Javascript, Emacs Lisp and C, I know git and django and
pandas, I fear not unit testing or continuous integration, but
learning what ``%w[...]`` means will forever be beyond me!!!"
If you could learn that [...] means a list display or a list comp
depending on the contents, you can learn this. As I said before, I'm not
wedded to this particular syntax, but its an obvious mnemonic:
w is for *words*
[ ] are *list delimiters*
Put them together and you get a list of words.
> >Wherever possible, we should let the interpreter or compiler do the
> >repetitive stuff.
>
> I prefer to let my editor do the work, actually.
[...]
> and then write a quick editor macro to add the quotes and comma
Great. And how about those who cannot just "write a quick editor macro"
which works perfectly first time?
If writing out a list of words in Python source code is so painful that
you prefer to write a macro, that's a fantastic argument in favour of
this new syntax!
--
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/PVJI2XWARR5Y7C5G5NVVTI2HIMENGPMU/
Code of Conduct: http://python.org/psf/codeofconduct/