Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
Znafon
on March 6, 2019
|
parent
|
context
|
favorite
| on:
PEP 584 – Add + and – operators to the built-in di...
There is a conter proposal to use classmethod like this from another core developer.
rurban
on March 6, 2019
[–]
with an object method you could return the changed dict (ref semantics, much faster) and as class methodcall you would return a copy, as with +.
d.merge(d1) vs dict.merge(d, d1)
So have the best of both worlds, and backwards compatible.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: