Home

At 10:46 AM 8/9/2007, Bill Scherer wrote:
>Dick Moores wrote:
> > >>> () is ()
> > True
> > >>> (1,) is (1,)
> > False
> >
> > Why?
> >
>
> >>> a = ()
> >>> b = ()
> >>> c = (1,)
> >>> d = (1,)
> >>> a is b
>True
> >>> c is d
>False
> >>> id(a)
>3086553132
> >>> id(b)
>3086553132
> >>> id(c)
>3086411340
> >>> id(d)
>3086390892
>
>
>There is only one empty tuple.
>Does that clear it up for you?

But isn't that the same as saying, "That's just the reality of
Python; it is what it is."? I want to know why there is only one
empty tuple, but more than one (1,).

Also,
>>> [] is []
False

Dick

previous
next

Re: Finding specific date ranges
Re: Modul (%) in python not like in C?
Re: Put a stl container in private or public?
Re: Getting original working directory
Re: python 3.0, pywin32 and scipy
pozycjonowanie warszawa
paraprotex opinie
Dekoracje okien
Mariquita
rtv