Re: The Folly of Python

Liste des GroupesRevenir à col advocacy 
Sujet : Re: The Folly of Python
De : OFeem1987 (at) *nospam* teleworm.us (Chris Ahlstrom)
Groupes : comp.os.linux.advocacy
Date : 16. Apr 2024, 13:58:07
Autres entêtes
Organisation : None
Message-ID : <uvlp4f$u64i$1@dont-email.me>
References : 1 2 3 4 5 6
User-Agent : slrn/1.0.3 (Linux)
rbowman wrote this copyrighted missive and expects royalties:

On Mon, 15 Apr 2024 21:16:46 -0400, DFS wrote:
>
What do you notice about those id numbers?
>
for i in range(1000, 1011): print("int %d, id = %d" % (i, id(i)))
...
int 1000, id = 133523511399088
int 1001, id = 133523511399056
int 1002, id = 133523511399088
int 1003, id = 133523511399056
int 1004, id = 133523511399088
int 1005, id = 133523511399056
int 1006, id = 133523511399088
int 1007, id = 133523511399056
int 1008, id = 133523511399088
int 1009, id = 133523511399056
int 1010, id = 133523511399088
>
or, for extra credit explain
>
for i in range(250, 261): print("int %d, id = %d" % (i, id(i)))
...
int 250, id = 133523513024528
int 251, id = 133523513024560
int 252, id = 133523513024592
int 253, id = 133523513024624
int 254, id = 133523513024656
int 255, id = 133523513024688
int 256, id = 133523513024720
int 257, id = 133523511399088
int 258, id = 133523511398960
int 259, id = 133523511399088
int 260, id = 133523511398960

Ahh the indeterminate beauty of garbage collection!

--
Q: Why did the astrophysicist order three hamburgers?
A: Because he was hungry.

Date Sujet#  Auteur
5 Oct 24 o 

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal