What "kind" of Python to start with? [closed]
Asked Answered
G

3

5

I want to learn python so I downloaded it from the python site and I saw 4 other kinds of pythons appear:

  • Python (normal)
  • IronPython
  • Jython
  • PyPy
  • Stackless Python

I can really find what the differents are between these. Also which one is the best to start with.

Gurrola answered 20/6, 2012 at 20:3 Comment(2)
Start with CPython (the normal Python)Topdrawer
Each is a implementation of Python language specification. CPython is normal python and the standard python development. Others are variation to support different aspects not supported by CPythonImmunoreaction
E
10

Updated to include corrections from kind people in the comments section:

Of the python implementations you mention, the original and most commonly used is CPython (python on your list - which is an interpreter for python implemented in C and running as a native application) and is available for pretty much every platform under the sun. The other variants are:

  • IronPython: runs on the .Net common runtime (interfaces more cleanly with other .Net apps)
  • Jython: runs on the JVM (interfaces more cleanly with Java and other JVM apps)
  • PyPy: A Python interpreter which includes a just-in-time compiler which can significantly increase program execution performance. The interpreter and JIT are implemented in RPython (rather than C), a restricted subset of Python which is amenable to static analysis and type inference.
  • Stackless Python: An implementation of a python interpreter which doesn't rely on recursion on the native C runtime stack, and therefore allows a load of other interesting programming constructs and techniques (including lightweight threads) not available in CPython.

There are a large variety of libraries for Python (one of the major advantages of the language), the majority developed for CPython. For a number of compatibility reasons, none of the variants above currently support as many as the main implementation. So for this reason, CPython is the best place to start, and then if your future requirements fit one of the other platforms - you'll be in a good place to learn the variations from a solid grounding in the basics.

Euclid answered 20/6, 2012 at 20:14 Comment(6)
A point of clarification: PyPy is not a Python compiler implemented in Python. It is (1) a compiler for RPython (a different language than Python), and (2) a Python interpreter which includes a JIT. (1) exists to compile (2), which is implemented in RPython. PyPy will never enable compilation of Python programs to native binaries.Radiant
Please actually fix the answer. The current explanation is misleading at best, and I wouldn't rely on everyone reading the comments. While your're at it, you may want to change the last paragraph as well. PyPy implements the entirety of Python 2.7, module a few (mostly obscure) implementation details and part of the C API, so almost all Python code and a number (though I can't tell if it's the majority) of useful C extensions work. I'm pretty certain Stackless and IronPython are also quite up-to-date and compatible, but I haven't looked much into them.Rig
@delnan: I'll update as suggested by Ben. As for compatibility of libraries, I regularly use PyQt and numpy and understood that neither are yet fully available from PyPy. Also that, despite the existence of the ironclad project, not all CPython modules can be called from IronPython. I don't know about Stackless - but given that one of the major draws of Python is the sheer coverage of the modules available to CPython (on which most tutorials etc are based) it would seem valid to suggest that is a good starting point. I remain open to persuasion otherwise though.Euclid
I absolutely agree that CPython is a better starting point. There is no reason not to use it, and as you say, compatibility is not 100%. However, your answer currently reads as if the compatibility is generally less than 50%, which is not true if we assume the majority of all Python modules work without using the C API, or only uses the subset which PyPy supports well. And I'd say that is the case. Certain libraries, such PyQt (though I believe someone got it working) and and NumPy (being worked on, but seriously WIP) are missing, but a lot of projects can do without those.Rig
@delnan. I've clarified the module compatibility points too. Last time I checked all of these was about three years ago - so I was somewhat out of date. Thanks for putting me right. Hope the answer fits the bill a bit better now.Euclid
+10 if I could, now it's a pretty-much-perfect answer :)Rig
R
4

Python. All the documentation you'll find for learning the language assumes this. Then if you find a need for one of the other implementations the documentation will assume you know Python and explain the differences.

Radiant answered 20/6, 2012 at 20:6 Comment(0)
V
3

Start with Python.

The alternatives are for special use cases that apply mostly when you are integrating Python with other languages, which is a very advanced usage of the language.

Valedictorian answered 20/6, 2012 at 20:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.