[issue36144] Dictionary addition. (PEP 584)

2020-02-25 Thread Steve Dower
Steve Dower added the comment: That's a much simpler example. And of course: >>> z[False] = False >>> z {0: False} So the precedent is well established that the key doesn't get updated with the value. No further questions, yer honour ;) -- ___

[issue36144] Dictionary addition. (PEP 584)

2020-02-25 Thread Brandt Bucher
Brandt Bucher added the comment: As a somewhat simpler example: >>> f = {False: False} >>> z = {0: 0} >>> f | z {False: 0} >>> {**f, **z} {False: 0} >>> f.update(z); f {False: 0} Though these hairier cases aren't explicitly addressed, the conflict behavior is covered in the Rationale and

[issue36144] Dictionary addition. (PEP 584)

2020-02-25 Thread Steve Dower
Steve Dower added the comment: Not sure if this is a big deal or not, and it seems likely that the preexisting behaviour of .update() and ** unpacking have already decided it, but is it intentional that you end up with the first-seen key and the last-seen value in the case of collisions?

[issue36144] Dictionary addition. (PEP 584)

2020-02-25 Thread Brandt Bucher
Change by Brandt Bucher : -- pull_requests: +18020 pull_request: https://github.com/python/cpython/pull/18659 ___ Python tracker ___

[issue36144] Dictionary addition. (PEP 584)

2020-02-25 Thread Guido van Rossum
Guido van Rossum added the comment: Yup, great plan. On Mon, Feb 24, 2020 at 22:29 Brandt Bucher wrote: > > Brandt Bucher added the comment: > > My current PR plans are: > > - Docs. This will include the dict docs and the whatsnew 3.9. I assume we > have no plans to cover this in the

[issue36144] Dictionary addition. (PEP 584)

2020-02-24 Thread Brandt Bucher
Brandt Bucher added the comment: My current PR plans are: - Docs. This will include the dict docs and the whatsnew 3.9. I assume we have no plans to cover this in the tutorials, etc. Let me know if I'm missing anything here. - collections.defaultdict, with tests. I don't think this needs

[issue36144] Dictionary addition. (PEP 584)

2020-02-24 Thread Guido van Rossum
Guido van Rossum added the comment: While the main code has been merged now, I propose to keep this issue open until some other things have happened: - Documentation - Add | operators to some dict subclasses in the stdlib - (What else?) -- ___

[issue36144] Dictionary addition. (PEP 584)

2020-02-24 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset eb8ac57af26c4eb96a8230eba7492ce5ceef7886 by Brandt Bucher in branch 'master': bpo-36144: Dictionary Union (PEP 584) (#12088) https://github.com/python/cpython/commit/eb8ac57af26c4eb96a8230eba7492ce5ceef7886 --

[issue36144] Dictionary addition. (PEP 584)

2020-02-24 Thread Guido van Rossum
Guido van Rossum added the comment: PEP 584 has been approved by the Steering Council (at my recommendation). We will shortly begin landing PRs related to this. -- versions: +Python 3.9 -Python 3.8 ___ Python tracker

[issue36144] Dictionary addition. (PEP 584)

2019-12-12 Thread Aaron Hall
Aaron Hall added the comment: Another obvious way to do it, but I'm +1 on it. A small side point however - PEP 584 reads: > To create a new dict containing the merged items of two (or more) dicts, one > can currently write: > {**d1, **d2} > but this is neither obvious nor easily

[issue36144] Dictionary addition. (PEP 584)

2019-03-05 Thread STINNER Victor
STINNER Victor added the comment: > Is this issue directly or indirectly related to the PEP 584 "Add + and - > operators to the built-in dict class"? > https://www.python.org/dev/peps/pep-0584/ Ah yes, it's written in the title of the PR. I add it to the bug title as well. -- title:

[issue36144] Dictionary addition. (PEP 584)

2019-03-05 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: