From: Peter Otten on
francogrex wrote:

> Hi, I'm not a Python programmer but I'm
> interested in it and I found this table from
> Norvig that dates for some years (I re-posted
> it temporarily on my site below to take it out
> of context a little). I'm not interested in
> any comparisons only in the Python features (
> last column), can someone whether the
> information in the Python features column is
> still correct today. Thanks

The original page is here:

http://norvig.com/python-lisp.html

Yes, the table is fairly up-to-date and general enough to stay up-to-date
for the next few years.

Peter
From: Thomas Jollans on
On 07/24/2010 02:45 PM, francogrex wrote:
> Hi, I'm not a Python programmer but I'm
> interested in it and I found this table from
> Norvig that dates for some years (I re-posted
> it temporarily on my site below to take it out
> of context a little). I'm not interested in
> any comparisons only in the Python features (
> last column), can someone whether the
> information in the Python features column is
> still correct today. Thanks

Mostly all true, with a few changes and inaccuracies. And a definite
bias towards the LISP. (and the author didn't even specify a dialect on
lisp. My my...)


> "Support heterogeneous lists" ==> "Yes (array)"

This is nonsense, and has always been.
Python lists (not arrays) have always been heterogeneous. They store
objects and don't care about the type. Python arrays (from the array
module) are homogeneous, and limited to storing numerical data. Quite a
different beast.

> "Number of implementations" ==> [...]branches[...]

I wouldn't cann Jython a branch. You could say that there are currently
two major branches of the Python language, and the CPython interpreter:
Python 2.x and Python 3.x. There are a number of implementations of
Python, the big names being CPython, Jython, IronPython, and PyPy

> Data types:

Python 2's int and long (there called integer and bignum) are now
(Python 3.x) a single type.
Again, the author of the table reveals that he is is a lisp programmer
only passingly acquainted with Python: Python lists are *not* arrays.
They are (linked) lists. They're not identical to lisp (cons'd) lists,
but they are, nonetheless, lists, not arrays.

> Exceptions:

string exceptions, as demonstrated in the table, are gone in Python 3.

> "no other control structures"

now that's a bit hard on Python. Technically true perhaps, but the
author could have mentioned generators somewhere.

> function application

apply is gone in Python 3.x -- use the fn(*args) syntax instead.
Also, execfile("file.py") is NOT identical to import file.

> other high-order functions

Check out itertools and functools. (std library)

> "close over writable var"

Can be done in Python 3.x with the nonlocal keyword. Also, to a point,
objects have always supported the same behaviour, with a twist.

> FEATURES
> "quotation"

The way this is presented doesn't really fit with Python. Very lisp way
to look at quotation.

> "operations on arrays"

ahem.
From: Brian Quinlan on

On 24 Jul 2010, at 23:19, Thomas Jollans wrote:
>> "Support heterogeneous lists" ==> "Yes (array)"
>
> This is nonsense, and has always been.
> Python lists (not arrays) have always been heterogeneous. They store
> objects and don't care about the type. Python arrays (from the array
> module) are homogeneous, and limited to storing numerical data.
> Quite a
> different beast.

He means that Python lists are implemented using arrays, not that the
Python "array" module provides the functionality.

Cheers,
Brian

From: Peter Otten on
Thomas Jollans wrote:

>> "Support heterogeneous lists" ==> "Yes (array)"
>
> This is nonsense, and has always been.

I think you are misunderstanding that statement. Python's list stores its
items in a continuous chunk of memory, a layout that is called array in
common CS terminology as opposed to lists which are typically linked lists.

Peter

From: Thomas Jollans on
On 07/24/2010 03:48 PM, Brian Quinlan wrote:
>
> On 24 Jul 2010, at 23:19, Thomas Jollans wrote:
>>> "Support heterogeneous lists" ==> "Yes (array)"
>>
>> This is nonsense, and has always been.
>> Python lists (not arrays) have always been heterogeneous. They store
>> objects and don't care about the type. Python arrays (from the array
>> module) are homogeneous, and limited to storing numerical data. Quite a
>> different beast.
>
> He means that Python lists are implemented using arrays, not that the
> Python "array" module provides the functionality.

Oh dear, and all this time I thought python lists where implemented as
lists, without ever checking the code.