On Tue, Mar 5, 2019 at 5:23 PM Chris Angelico <rosuav@gmail.com> wrote:
On Tue, Mar 5, 2019 at 6:40 PM INADA Naoki <songofacandy@gmail.com> wrote:
This is why function and methods are better:
* Easy to search.
## Merits of dict.merge() over operator +
* Easy to Google (e.g. "python dict merge").
This keeps getting thrown around. It's simply not true.
https://www.google.com/search?q=%7B**d1%2C+**d2%7D
First hit when I do that search is Stack Overflow:
https://stackoverflow.com/questions/2255878/what-does-mean-in-the-expression...
which, while it's not specifically about that exact syntax, does mention it in the comments on the question. Symbols ARE searchable. In fact, adding the word "python" to the beginning of that search produces a number of very useful hits, including a Reddit thread on combining dictionaries, and PEP 584 itself.
Please can people actually test these lines of argument before reiterating them?
ChrisA
I'm surprised {**d1, **d2} is searchable. But in my proposal, I compared with one character operator `+`. I switched my browser as English and Googled "python str +" https://www.google.com/search?q=python+str+%2B&oq=python+str+%2B As far as I can see, top result is https://docs.python.org/2/library/string.html When I search "+" in the page, it's difficult to find concat string. I tried Google "python set union" and "python set |" too. "union" is much easier to reach the answer. So I don't think "name is easier to Google than symbol" is a fake or FUD. Regards, -- INADA Naoki <songofacandy@gmail.com>