LWN: Comments on "New operators for Python dicts?" https://lwn.net/Articles/635397/ This is a special feed containing comments posted to the individual LWN article titled "New operators for Python dicts?". en-us Thu, 11 Sep 2025 08:54:45 +0000 Thu, 11 Sep 2025 08:54:45 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net New operators for Python dicts? https://lwn.net/Articles/635919/ https://lwn.net/Articles/635919/ marcH <div class="FormattedComment"> <font class="QuotedText">&gt; Dictionaries (or dicts) are also known as associative arrays or *hashes* in other languages.</font><br> <p> Mmmm... let's see which confused languages mix up feature and implementation...<br> <p> (Cheap shot; sorry)<br> <p> <p> </div> Mon, 09 Mar 2015 07:18:28 +0000 What about parallel case of sets? https://lwn.net/Articles/635807/ https://lwn.net/Articles/635807/ droundy <div class="FormattedComment"> Given that dicts are so much closer to sets than lists, I was puzzled that the article didn't discuss the comparison with python's set syntax.<br> <p> In particular, sets use | and |= where + and += are being proposed for dicts.<br> </div> Sat, 07 Mar 2015 01:20:54 +0000 New operators for Python dicts? https://lwn.net/Articles/635607/ https://lwn.net/Articles/635607/ dashesy <div class="FormattedComment"> Or maybe better leave dicts alone and start using Pandas for fancy data manipulations, joins, merge, ... <br> <p> </div> Thu, 05 Mar 2015 17:37:50 +0000 New operators for Python dicts? https://lwn.net/Articles/635583/ https://lwn.net/Articles/635583/ zyga <div class="FormattedComment"> I'd like to clarify that __iadd__ and += are not that similar (when compared to __add__ and +).<br> <p> Consider:<br> <p> a = 1<br> a += 1<br> <p> This calls int.__add__ as int.__iadd__ doesn't exist.<br> <p> += will always work if + is defined<br> __iadd__ may not be defined for certain types<br> </div> Thu, 05 Mar 2015 14:30:34 +0000