Message362663
| Author | brandtbucher |
|---|---|
| Recipients | Aaron Hall, brandtbucher, gvanrossum, josh.r, mark.dickinson, rhettinger, scoder, serhiy.storchaka, slam, steve.dower, xtreak |
| Date | 2020-02-25.20:19:59 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <1582661999.96.0.0843914842698.issue36144@roundup.psfhosted.org> |
| In-reply-to |
| Content | |
|---|---|
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 Reference Implementation sections of the PEP. All of the above examples share code (`dict_update_arg`), and that's definitely intentional. I for one think it would be confusing (and probably a bug) if one of the examples above gave a different key-value pair!
I find it makes more sense if you see a set as valueless keys (rather than keyless values). |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2020-02-25 20:20:00 | brandtbucher | set | recipients: + brandtbucher, gvanrossum, rhettinger, mark.dickinson, scoder, serhiy.storchaka, steve.dower, josh.r, Aaron Hall, slam, xtreak |
| 2020-02-25 20:19:59 | brandtbucher | set | messageid: <1582661999.96.0.0843914842698.issue36144@roundup.psfhosted.org> |
| 2020-02-25 20:19:59 | brandtbucher | link | issue36144 messages |
| 2020-02-25 20:19:59 | brandtbucher | create | |