On Sat, Feb 15, 2014 at 1:34 PM, Rustom Mody <rustompm...@gmail.com> wrote:
> At what level can you explain the following?
>
>>>> x = 1234567 * 1234567
>>>> x
> 1524155677489L

Well, for a start, I'd use Python 3, so there's no need to explain why
some numbers have an L after them :)

> As against
>
>>>> x = 2*3
>>>> 6 is x
> True
>
> "Interning" you will say.
> Is interning a simple matter for example at the level of questioning of the 
> OP?

When it's utterly impossible for it to matter in any way, Python is
allowed to reuse objects.

I think that's simple enough to explain. There's nothing you can do to
distinguish one 6 from another, so Python's allowed to have them the
same.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to