[Chicago] I don't get why this works

Brantley Harris deadwisdom at gmail.com
Tue Apr 2 05:24:46 CEST 2013

> a = {}
> a['a'] = a[a['a']] = 'b'
{'a': 'b', 'b': 'b'}

What the what?  I would think that should KeyError, but it runs fine.
 Someone splain.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20130401/0a4bda06/attachment.html>

More information about the Chicago mailing list