Help with changes in traceback stack from Python 2.7 to Python 3.x

Chris Angelico rosuav at gmail.com
Sun Apr 27 22:19:02 EDT 2014


On Mon, Apr 28, 2014 at 12:11 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> Suppose we could pass variables directly to the constructor, like this:
>
> a = b = 2
> L = [1, 2, 3]
> dctA = dict(a, b, L[1], 2, 1+1)
>
> Obviously all five values are 2, but what are the keys?
>
> The dict construct
> receives five arguments, all bound to the object 2. (That might be the
> same object five times, or five distinct objects, all with the same value
> of 2.)

Just to nit-pick: A conforming Python implementation might pass up to
four distinct objects, but the first two MUST be the same object. :)

ChrisA



More information about the Python-list mailing list