On 21/05/2020 13:24, Chris Angelico wrote:
On Thu, May 21, 2020 at 9:58 PM Rhodri James <rho...@kynesim.co.uk> wrote:
On 20/05/2020 23:20, James Lu wrote:
There's a thirty year tradition of doing that because there's no
terser way to do it.
Terser does not mean better. In my experience, terser code is often
harder to comprehend, particularly when you are talking about squashing
a couple of lines together like this.
Except when it's more expressive. Imagine if Python didn't have ANY
argument defaults, merely permitted you to make arguments optional:
def int(x, ?base):
if base is UNSET:
base = 10
...
Would you agree that simply writing "base=10" is better?
You're right that terser does not ALWAYS mean better, but "more
expressive" often compasses both better and terser. Terser definitely
does not mean worse.
True, and I was careful to say "often" rather than "always". My point
is that James' argument appears to be solely that what he proposes is
terser.
--
Rhodri James *-* Kynesim Ltd
_______________________________________________
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/4Q6WIPN6B54Q4VAZJXDMM4FXS767MYNE/
Code of Conduct: http://python.org/psf/codeofconduct/