On Wed, Apr 22, 2020 at 12:06 AM Eric V. Smith <e...@trueblade.com> wrote:
> That's a good example, Chris. Thanks. I also don't see that a namespace
> object would buy you much, if anything.
>
> Going with the tersest proposal (twitter=twitter becomes twitter=), we'd
> save something like 40 characters in the function call in the return
> statement. I think making a change isn't worth adding more to the
> language, but of course reasonable people can disagree.
>

Thanks. But it's really not about terseness. I've already typed more
in this thread than I'll probably save over a lifetime of
shorthanding. If I wanted shorthands, I'd just use shorter variable
names.

Removing duplication removes the possibility of desynchronization.
It's far easier to see that "twitter=," is passing twitter with the
same name than to check that all the instances of "twitter=twitter"
and "channel=channel" and "tweets=tweets" are all perfectly correct.
It also becomes a logical idiom for "pass these things to the
template, as-is", rather than getting bogged down in the mechanics.

Having worked with (many) languages that don't have keyword arguments
at all, I've gotten all too accustomed to the hassles of wrapping
things up into objects. Consider the difference between positional and
keyword arguments in the JavaScript fetch() function [1], where the
URL to be fetched is passed positionally, and everything else is... an
object passed as the second parameter. That is exactly the sort of
fiddliness that I'm trying to avoid.

ChrisA

[1] 
https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch
_______________________________________________
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/YJA3Q36FUQWLHCY36RVSTHAOUDTE6JEF/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to