I tried erlang-ish [1|2] in python and something came out...

process circularfunc at gmail.com
Sun Sep 21 13:02:47 EDT 2008


In erlang you can cons like this: [1|2]. i tried this in python and it
didnt raise an error but i dont know what the result do

>>> [1|2]
[3]
>>> [2|2]
[2]
>>> a = [2|2]
>>> a
[2]
>>> [2|3]
[3]
>>> [2|1]
[3]
>>>



More information about the Python-list mailing list