Guido van Rossum wrote: >>But those feelings are no proof of anything. How do we get the >>confirmation that using rationals in Python would be easy going and >>innocuous in practice, beforehand? > > > By adding them to the language but as an isolated type. The right > conversions should happen when you mix rationals with other types of > numbers (int/long -> rational -> float -> complex), but no operations > should return rationals unless a rational goes in. +1 Note that I started to work on mxNumber to get a feeling for how well rationals et al. fit the existing world. Turns out that having separate types is a goog thing. Here's the coercion scheme I'm using: mx.Number.Float ^ | --------> Python float | ^ | | | mx.Number.Rational | ^ | | Python long --> mx.Number.Integer ^ ^ | | -------- Python integer -- Marc-Andre Lemburg CEO eGenix.com Software GmbH _______________________________________________________________________ eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,... Python Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/
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