<story><title>Migrating to Python 3 with pleasure</title><url>http://github.com/arogozhnikov/python3_with_pleasure</url></story><parent_chain><item><author>re</author><text>I&amp;#x27;ve been toying around with Python 3 and using it for most of my personal&amp;#x2F;hack projects, but I somehow missed the unpacking improvements: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;www.python.org&amp;#x2F;dev&amp;#x2F;peps&amp;#x2F;pep-0448&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;www.python.org&amp;#x2F;dev&amp;#x2F;peps&amp;#x2F;pep-0448&amp;#x2F;&lt;/a&gt;&lt;p&gt;In particular, being able to create an updated copy of a dict with a single expression is pretty cool:&lt;p&gt;&lt;pre&gt;&lt;code&gt;    return {**old, &amp;#x27;foo&amp;#x27;: &amp;#x27;bar&amp;#x27;}
    
    # Old way
    new = old.copy
    new[&amp;#x27;foo&amp;#x27;] = [&amp;#x27;bar&amp;#x27;]
    return new&lt;/code&gt;&lt;/pre&gt;</text></item></parent_chain><comment><author>est</author><text>&lt;p&gt;&lt;pre&gt;&lt;code&gt;    return {**old, &amp;#x27;foo&amp;#x27;: &amp;#x27;bar&amp;#x27;}
    
    # Old way
    return dict(old, foo=&amp;#x27;bar&amp;#x27;)
&lt;/code&gt;&lt;/pre&gt;
Not much difference if you ask me.</text></comment>
<story><title>Migrating to Python 3 with pleasure</title><url>http://github.com/arogozhnikov/python3_with_pleasure</url></story><parent_chain><item><author>re</author><text>I&amp;#x27;ve been toying around with Python 3 and using it for most of my personal&amp;#x2F;hack projects, but I somehow missed the unpacking improvements: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;www.python.org&amp;#x2F;dev&amp;#x2F;peps&amp;#x2F;pep-0448&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;www.python.org&amp;#x2F;dev&amp;#x2F;peps&amp;#x2F;pep-0448&amp;#x2F;&lt;/a&gt;&lt;p&gt;In particular, being able to create an updated copy of a dict with a single expression is pretty cool:&lt;p&gt;&lt;pre&gt;&lt;code&gt;    return {**old, &amp;#x27;foo&amp;#x27;: &amp;#x27;bar&amp;#x27;}
    
    # Old way
    new = old.copy
    new[&amp;#x27;foo&amp;#x27;] = [&amp;#x27;bar&amp;#x27;]
    return new&lt;/code&gt;&lt;/pre&gt;</text></item></parent_chain><comment><author>miracle2k</author><text>My mind is blown. Ever since JavaScript added this, I&amp;#x27;ve been wanting it in Python... and somehow it was there all along. It works for lists too!&lt;p&gt;&lt;pre&gt;&lt;code&gt;    [*a, *b, *c]&lt;/code&gt;&lt;/pre&gt;</text></comment>