Pascal int()
Moshe Zadka
moshez at math.huji.ac.il
Mon Mar 20 15:23:49 EST 2000
On Mon, 20 Mar 2000, John W. Baxter wrote:
> (Various language implementations--some LISPs, some SmallTalks--show
> that by sacrificing some of the range of int, one can make int a class
> quite nicely. I doubt that there would be many votes in favor of
> reducing int to 29 bits (or whatever).)
The reason "int" isn't a class in Python is unrelated to this -- it's just
the classic type/class dichotomy we all know. The range reducing is an
optimization techinque, making small integers immediate rather then boxed
values. Currently, all Python values are boxed. I hope that Py3K will
remove the distinction between ints and longs, and allow us to experiment
with making integers, None, and maybe even single-character strings
immediate values -- but that is all implementation: the user does not
notice any of it.
--
Moshe Zadka <mzadka at geocities.com>.
http://www.oreilly.com/news/prescod_0300.html
http://www.linux.org.il -- we put the penguin in .com
More information about the Python-list
mailing list