2 comments

[ 45.0 ms ] story [ 271 ms ] thread
I'm excited for the dict merge operator.

    >>> d = {'spam': 1, 'eggs': 2, 'cheese': 3}
    >>> e = {'cheese': 'cheddar', 'aardvark': 'Ethel'}
    >>> d | e
    {'spam': 1, 'eggs': 2, 'cheese': 'cheddar', 'aardvark': 'Ethel'}
    >>> e | d
    {'aardvark': 'Ethel', 'spam': 1, 'eggs': 2, 'cheese': 3}
Awesome: when Python is initialized multiple times in the same process, it does not leak memory anymore