Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

Steven D'Aprano steve+comp.lang.python at pearwood.info
Fri Apr 4 20:00:54 EDT 2014


On Fri, 04 Apr 2014 15:58:29 -0500, Mark H Harris wrote:

> Oh, I have another serious question about implementations. I'm not sure
> about (50) implementations, 

Here's a list. Which ones you count as actual implementations of Python 
and which are not may be a matter of opinion. (Do translators count? 
Supersets and subsets of the language? How many changes can one make 
before you have a completely different language? I haven't included 
obviously different languages like Cobra and Delight.)

Berp, Brython, CLPython, CPython, CapPython, ChinesePython, Compyler, 
Copperhead, Cython, HoPe, HotPy, IronPython, Jython, Kivy, Mypy, Mython, 
Nuitka, Numba, Parakeet, Parallel Python, Perthon, Pippy, Psyco, Py4A, 
PyMite, PyMT, PyPad, PyPy, PyQNX, PyVM, Pycorn, Pyjamas, Pynie, 
Pystachio, Pyston, Python for .NET, Python for OS/2, Python for S60, 
Python-iPod, Python2C, Pythonce, Pythonium Core, Pythran, QPython, 
RapydScript, Shedskin, Skulpt, Stackless, TinyPy, Typhon, UnPython, 
Unladen Swallow, Vyper, WPython

As I said, some of these may be abandoned, obsolete, experimental, or 
even vapourware. Some are probably just ports of CPython to another 
platform rather than completely independent implementations. The "big 
four" are CPython, IronPython, Jython and PyPy, although Stackless is 
still maintained and in active use as part of the EVE Online game. 
Stackless is older than all of them except CPython itself. Cython is a 
superset of Python, but it is capable of running pure Python code, so it 
counts as a Python compiler, and is in very active development and use. 
Nuitika is a static compiler written by a developer willing to go against 
the conventional wisdom that JIT compilers are the way to go for dynamic 
languages like Python, and he claims to have impressive speedups.


> but I know that Jython and IronPython are
> serious contenders (although, I have not, nor probably will, use them).

If you are using a Debian-based system, it is trivial to install them via 
apt-get or aptitude:

    sudo aptitude install jython ironpython


> Are the other implementation communities *also* supporting two versions
> of the language?   Is there a Jython2 &also a Jython3 ?

Not Jython or IronPython yet. As far as I know, the implementations which 
support Python 3 are CPython, Cython, Kivy, Nuitika and PyPy.



-- 
Steven D'Aprano
http://import-that.dreamwidth.org/



More information about the Python-list mailing list