Unrelated to python 3.7, but they recently added this feature that you can add two dictionaries together in 3.5 by doing: new_dict = {**dict1, **dict2} It is so handy and nice
What’s New in Python 3.7
41–50 of 70 posts
Re: What’s New in Python 3.7
#42Unrelated to python 3.7, but they recently added this feature that you can add two dictionaries together in 3.5 by doing: new_dict = {**dict1, **dict2} It is so handy and nice
Ah, great. This used to be rather clunky to do.
dict(dict1, **dict2)Re: What’s New in Python 3.7
#43Unrelated to python 3.7, but they recently added this feature that you can add two dictionaries together in 3.5 by doing: new_dict = {**dict1, **dict2} It is so handy and nice
Re: What’s New in Python 3.7
#44Earlier quoted context omitted.
Are you American? Americans always think that changing the encoding is a minor detail. Guess what, changing the default encoding breaks every language that is not English.
If it was changed from ascii to utf-8, how does it break everyting else ?
Characters are encoded in one byte and ascii leaves the highest 128 characters undefined. They are interpreted system-wise, depends on the locale and user settings.
Re: What’s New in Python 3.7
#45> Support for building --without-threads is removed. (Contributed by Antoine Pitrou in bpo-31370.). Woooo! That means, at some future time, I'll be able to remove code checks for non-threading Pythons.
Re: What’s New in Python 3.7
#46Earlier quoted context omitted.
Are you American? Americans always think that changing the encoding is a minor detail. Guess what, changing the default encoding breaks every language that is not English.
I'm Finnish, thank you for asking, so I'm quite aware of different encodings.
Re: What’s New in Python 3.7
#47Unrelated to python 3.7, but they recently added this feature that you can add two dictionaries together in 3.5 by doing: new_dict = {**dict1, **dict2} It is so handy and nice
Why doesn't the + symbol work?
Re: What’s New in Python 3.7
#48Re: What’s New in Python 3.7
#49Earlier quoted context omitted.
+ is not a supported operand for dict. You can probably subclass dict and add the plus operand
Why add that crazy syntax when a + would be a lot clearer?
Given
a = {1: 1}
b = {2: 2}
This c = {**a, **b}
is equivalent to c = {1: 1, 2: 2}Re: What’s New in Python 3.7
#50Earlier quoted context omitted.
Ah, great. This used to be rather clunky to do.
Really? This is how that was done in Python 2.7 and it doesn't seem that much clunkier to me... dict(dict1, **dict2)