A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2001-November/018316.html below:

[Python-Dev] Future division detection

[Python-Dev] Future division detection [Python-Dev] Future division detectionChristopher A. Craig com-nospam@ccraig.org
01 Nov 2001 09:03:57 -0500
I am in the process of porting my cRat module to take advantage of
some of the new features in Python 2.2 (and possibly making a patch
out of it to address PEP239 (though not for Python 2.2 obviously)).

While doing this I was thinking that I would change true_division on
ints and floats to return a rational and change the rational code to
return a long if the denominator is 1.  This works great, except that
if future division is off then rationals can suddenly become longs and
do not automatically cast back.  This makes it virtually impossible to
guarantee a correct result to nearly any rational computation that
involves a division.  

So I wanted to know if there is some way to detect, at the object
level, if the CO_FUTURE_DIVISION feature is active.

rational'ly y'rs

-- 
Christopher A. Craig <com-nospam@ccraig.org>



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4