Timeline for How do I merge two dictionaries in a single expression in Python?
Current License: CC BY-SA 3.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 10, 2019 at 16:27 | comment | added | Carl Meyer | @amcgregor You missed the key phrase "if y has any non-string keys." That's what doesn't work in Python3; the fact that it works in CPython 2 is an implementation detail that can't be relied on. IFF all your keys are guaranteed to be strings, this is a fully supported option. | |
Apr 12, 2019 at 13:10 | comment | added | amcgregor | Works fine in Python 3 and PyPy and PyPy 3, can't speak to Jython or Iron. Given this pattern is explicitly documented (see the third constructor form in this documentation) I'd argue it's not an "implementation detail" but intentional feature use. | |
Jan 21, 2016 at 6:43 | history | edited | Carl Meyer | CC BY-SA 3.0 |
Clarify that this doesn't work with non-string keys in any version of Python 3.
|
May 13, 2011 at 1:03 | history | edited | Carl Meyer | CC BY-SA 3.0 |
added disclaimer
|
Feb 11, 2011 at 16:32 | vote | accept | Carl Meyer | ||
May 13, 2011 at 1:03 | |||||
Jan 11, 2009 at 18:21 | history | edited | Carl Meyer | CC BY-SA 2.5 |
removed cruft
|
Sep 2, 2008 at 18:03 | history | rollback | Carl Meyer |
Rollback to Revision 1
|
|
Sep 2, 2008 at 18:03 | history | edited | Carl Meyer | CC BY-SA 2.5 |
testing underscore issues
|
Sep 2, 2008 at 15:52 | history | answered | Carl Meyer | CC BY-SA 2.5 |