proposed language change to int/int==float (was: PEP0238 lament)

Dave Cole djc at object-craft.com.au
Thu Jul 26 20:35:12 EDT 2001


>>>>> "Guido" == Guido van Rossum <guido at python.org> writes:

Guido> For example, a dict with int keys can be indexed with
Guido> corresponding float or complex values.

You are a legendissimo!!!

I implemented an extension type for the Sybase native NUMERIC column
type in my Sybase module but never really gave things like this much
thought.

Now I know why I do not bother adding my 2c to arguments regarding
fundamental language features...

ferret:/home/djc% python
Python 2.0.1 (#0, Jun 23 2001, 23:50:30) 
[GCC 2.95.4 20010319 (Debian prerelease)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> import Sybase
>>> dict = { 42: 'the answer' }
>>> n = Sybase.numeric(42)
>>> n.precision, n.scale
(16, 0)
>>> dict[n]
'the answer'
>>> n = Sybase.numeric('123456789012345678901234567890.123456789123456789')
>>> n.precision, n.scale
(49, 18)
>>> n
123456789012345678901234567890.123456789123456789
>>> n * 2
246913578024691357802469135780.246913578246913578
>>> 

- Dave

-- 
http://www.object-craft.com.au



More information about the Python-list mailing list