Re: Two aces up Python's sleeve

Liste des GroupesRevenir à cl python 
Sujet : Re: Two aces up Python's sleeve
De : greg.ewing (at) *nospam* canterbury.ac.nz (Greg Ewing)
Groupes : comp.lang.python
Date : 07. Nov 2024, 23:15:38
Autres entêtes
Message-ID : <lp4sgdFg90oU1@mid.individual.net>
References : 1 2 3 4
User-Agent : Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:91.0) Gecko/20100101 Thunderbird/91.3.2
On 8/11/24 3:04 am, Mild Shock wrote:
This only works for small integers. I guess
this is because tagged pointers are used
nowadays ?
No, it's because integers in a certain small range are cached. Not sure what the actual range is nowadays, it used to be something like -5 to 256 I think.
BTW you have to be careful testing this, because the compiler sometimes does constant folding, so you need to be sure it's actually computing the numbers at run time.
--
Greg

Date Sujet#  Auteur
6 Nov 24 * Two aces up Python's sleeve15Stefan Ram
6 Nov 24 `* Re: Two aces up Python's sleeve14Mild Shock
7 Nov 24  `* Re: Two aces up Python's sleeve13Annada Behera
7 Nov 24   +- Re: Two aces up Python's sleeve1Stefan Ram
7 Nov 24   +* Re: Two aces up Python's sleeve6Mild Shock
8 Nov 24   i`* Re: Two aces up Python's sleeve5Greg Ewing
8 Nov 24   i +- Re: Two aces up Python's sleeve1dn
8 Nov 24   i `* Re: Two aces up Python's sleeve3Mild Shock
8 Nov 24   i  `* Re: Two aces up Python's sleeve2Mild Shock
8 Nov 24   i   `- Re: Two aces up Python's sleeve1Mild Shock
8 Nov 24   `* Re: Two aces up Python's sleeve (Posting On Python-List Prohibited)5Lawrence D'Oliveiro
8 Nov 24    `* Re: Two aces up Python's sleeve (Posting On Python-List Prohibited)4Mild Shock
8 Nov 24     +* Re: Two aces up Python's sleeve (Posting On Python-List Prohibited)2dn
8 Nov 24     i`- Re: Two aces up Python's sleeve (Posting On Python-List Prohibited)1Mild Shock
9 Nov 24     `- Re: Two aces up Python's sleeve (Posting On Python-List Prohibited)1Thomas Passin

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal