How about adding rational fraction to Python?

J. Cliff Dyer jcd at sdf.lonestar.org
Tue Feb 26 19:39:38 CET 2008


On Tue, 2008-02-26 at 10:08 -0500, D'Arcy J.M. Cain wrote:
> On Tue, 26 Feb 2008 06:45:45 -0800 (PST)
> Carl Banks <pavlovevidence at gmail.com> wrote:
> > On Feb 26, 9:29 am, "D'Arcy J.M. Cain" <da... at druid.net> wrote:
> > > If 3/4 ever returned 0.75 in any language I would drop that language.
> > 
> > Have fun dropping Python, then, chief.  Integer division with / is
> > already deprecated, can be disabled ever since Python 2.4, and will be
> > wholly removed in Python 3.0.
> 
> I have not been following Python development that closely lately so I
> was not aware of that. I guess I won't be going to Python 3 then.  It's
> great that Python wants to attract young, new programmers.  Too bad
> about us old farts I guess.
> 
> How soon before 2.x is completely deprecated and I have to become a
> Walmart greeter?


Given your stated criteria (that int OP int == int), you should be a
WalMart greeter now.

>>> a = 20000 * 20000
>>> b = 200000 * 200000
>>> type(a)
<type 'int'>
>>> type(b)
<type 'long'>

That's true at least back to Python 2.3.  But maybe you're just being
melodramatic, and will actually adapt to this change as well as all the
other changes that have occurred in the python language.








More information about the Python-list mailing list