Python 3k

I was just fooling around with the Python 3.0 alpha release. Floating results on integer division:

mike@slice:~$ python
Python 2.5.1 (r251:54863, May 2 2007, 16:56:35)
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 8 / 5
1
>>>
mike@slice:~$ cd src/Python-3.0a1/
mike@slice:~/src/Python-3.0a1$ ./python
Python 3.0a1 (py3k, Sep 1 2007, 19:58:38)
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 8 / 5
1.6000000000000001
>>>

Ain’t that nice? It’s the little things that make me smile.

This entry was posted in ThisIsMobility. Bookmark the permalink.

One Response to Python 3k

  1. I guess you already knew that:

    $ python
    Python 2.5.1 (r251:54863, Aug 29 2007, 23:48:33)
    [GCC 4.2.0 (Gentoo 4.2.0 p1.4)] on linux2
    Type “help”, “copyright”, “credits” or “license” for more information.
    >>> from __future__ import division
    >>> 8 / 5
    1.6000000000000001

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">