why () is () and [] is [] work in other way?

Chris Angelico rosuav at gmail.com
Thu Apr 26 02:36:33 EDT 2012


On Thu, Apr 26, 2012 at 3:48 PM, John Nagle <nagle at animats.com> wrote:
>   This assumes that everything is, internally, an object.  In CPython,
> that's the case, because Python is a naive interpreter and everything,
> including numbers, is "boxed".  That's not true of PyPy or Shed Skin.
> So does "is" have to force the creation of a temporary boxed object?

Interesting point. Presumably the only types that can be unboxed are
those for which identity vs equality is pretty much immaterial, so the
question won't really matter. I'd be inclined to either have it return
False if either/both is unboxed, or else return True if both are equal
unboxed numbers, whichever is the most convenient to implement.

My opinion doesn't matter--
My opinion doesn't matter--
My opinion doesn't matter, matter, matter, matter, matter!
(WS Gilbert, "Ruddigore")

ChrisA



More information about the Python-list mailing list