On 4/6/2014 7:48 PM, Steven D'Aprano wrote:
On Sun, 06 Apr 2014 23:10:47 +0300, Marko Rauhamaa wrote:

Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info>:

On Sun, 06 Apr 2014 12:05:16 +0300, Marko Rauhamaa wrote:
Python, BTW, is perfectly suitable for computer science.

I don't think it is. Python is not a pure functional language, so it's
very difficult to prove anything about the code apart from running it.

Many classic CS ideas are expressed in terms of an Algol-like language.
Nothing would prevent you from framing those ideas in a Python-like
(pseudo)language. The question is mostly whether you prefer begin/end,
braces or indentation.

Okay, I made an error in stating that it's because Python is not a pure
functional language. It's because Python is so dynamic that it is very
difficult to prove anything about the code apart from running it. Take
this code-snippet of Python:

n = len([1, 2, 3])

What can we say about it? Almost nothing!

One merely needs to stipulate that builtin names have not been rebound to give the answer: n is bound to 3. In the absence of code or text specifying otherwise, that is the reasonable default assumption and the one that most makes when reading code.

Restricting the usage of Python's flexibility does not make it another language. It makes it the actual language that the vast majority of programs are written in and that people assume when reading code.

--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to