Python 3.x

A language must be consistent and concise. Same things must look and feel the same, different things must look differently. This means we should be able to literally see the similarity or the difference.

The most important thing about a language is that there is no distinction between code and data. Code should be data, everything is a number from the CPU's perspective.

In Lisp we have this illusion because everything in Lisp is an expression - a list of symbols. This allows us to transform expressions on the read time and create new ones at run time.

In Python code is not data, but every bit of data is an object. Furthermore, some pieces of code are objects. It is close to an ideal.)

schiptsov@imedia-S2100:~$ python3
Python 3.4.0a0 (default:9214f8440c44, Nov 10 2012, 20:40:31) 
[GCC 4.2.1 Compatible Clang 3.2 (trunk 167676)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> type(1)
<class 'int'>
>>> type('a')
<class 'str'>
>>> type(())
<class 'tuple'>
>>> type([])
<class 'list'>
>>> type({})
<class 'dict'>
>>> def a():
...   pass
>>> type(a)
<class 'function'>
>>> class A:
...   pass
>>> type(A)
<class 'type'>

In Python they have List comprehensions, and not just for lists, but for Touples, Sets and Dicts. Thus we can see and feel the data.

To cope with intuitive aversion it is better to think that square-bracket notation in Python is not for Lists, but for something called Heterogeneous Vectors, so it feels more natural, and, by the way, implemented this way. Don't call them Lists, at least not in a Lisp-ish way. Vectors, Sequences, whatever.

Uniform and consistent syntax of Python3 makes looping constructs brief and elegant.

Actually, there is nothing to say about Python3. It must be mastered. Its tutorial is excellent, examples are self-evident, standard idioms are elegant. Its documentation is brief and well-written. Lots of people enjoy the language very much.

Just master it.

Last modified 7 years ago Last modified on Nov 11, 2012, 8:54:10 PM
Note: See TracWiki for help on using the wiki.