ArticleslgStudy

computer science

Stackless Python

Stackless Python is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Stackless Python rather than just read about it. In short: Stackless Python, or Stackless, is a discontinued Python programming language interpreter. Its GitHub repository has been archived since February 2025, and the project has been officially discontinued.

Key takeaways

  • Stackless Python belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Stackless Python to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Stackless Python from memory before moving on to harder problems.

Reference excerpt

Stackless Python, or Stackless, is a discontinued Python programming language interpreter. Its GitHub repository has been archived since February 2025, and the project has been officially discontinued. It was so named because it avoids depending on the C call stack for its own stack. In practice, Stackless Python uses the C stack, but the stack is cleared between function calls. The most prominent feature of Stackless is microthreads, which avoid much of the overhead associated with usual operating system threads. In addition to Python features, Stackless also adds support for coroutines, communication channels, and task serialization. The MMORPG game EVE Online is one of the major users of Stackless Python, since 2003 (with Python 2.1, then 2.3, 2.5, 2.7), and the company behind it Fenris Creations (previously CCP Games) one of the main contributor to it, but started to move away from it, i.e. started migration to Python 3 in 2026 (in the meantime they open sourced the game engine, and one part is a component "designed to match that of Stackless Python as closely as possible" though it diverges also).

Design With Stackless Python, a running program is split into microthreads that are managed by the language interpreter itself, not the operating system kernel—context switching and task scheduling is done purely in the interpreter (these are thus also regarded as a form of green thread). Microthreads manage the execution of different subtasks in a program on the same CPU core. Thus, they are an alternative to event-based asynchronous programming and also avoid the overhead of using separate threads for single-core programs (because no mode switching between user mode and kernel mode needs to be done, so CPU usage can be reduced). Although microthreads make it easier to deal with running subtasks on a single core, Stackless Python does not remove CPython's global interpreter lock (GIL), nor does it use multiple threads and/or processes. So it allows only cooperative multitasking on a shared CPU and not parallelism (preemption was originally not available but is now in some form). To use multiple CPU cores, one would still need to build an interprocess communication system on top of Stackless Python processes. Due to the considerable number of changes in the source, Stackless Python cannot be installed on a preexisting Python installation as an extension or library. It is instead a complete Python distribution in itself. The majority of Stackless's features have also been implemented in PyPy, a self-hosting Python interpreter and JIT compiler.

Use Although the whole Stackless is a separate distribution, its switching functionality has been successfully packaged as a CPython extension called greenlet. It is used by a number of libraries (e.g. gevent) to provide a green threading solution for CPython. Python since has received an alternative native solution for asynchronous programming running on a single thread: await/async. Stackless is used extensively in the implementation of the Eve Online massively multiplayer online game as well as in IronPort's mail platform.

See also

Erlang (programming language) Limbo (programming language) Go (programming language) SCOOP (software)

References

External links Official website Stackless Python Documentation for: 3.7-slp, 3.6-slp, 3.5-slp, 3.4-slp, 2.7-slp stackless on GitHub Multithreaded Game Scripting with Stackless Python by Harry Kalogirou Continuations and Stackless Python by Christian Tismer

Worked examples

Example 1 — a first encounter with Stackless Python

Start with the simplest possible case. Write down what Stackless Python claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Stackless Python before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Stackless Python ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Stackless Python

In research
Stackless Python appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Stackless Python in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Stackless Python is common in secondary-school and first-year university syllabi. It links to neighbouring topics Concurrent computing, Python (programming language) implementations, Software using the Python Software Foundation License, so understanding it makes those chapters shorter.
In everyday life
Look for Stackless Python outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Stackless Python” →

How to study Stackless Python in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Stackless Python means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Stackless Python out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Stackless Python in simple terms?

Stackless Python, or Stackless, is a discontinued Python programming language interpreter. Its GitHub repository has been archived since February 2025, and the project has been officially discontinued.

Why does Stackless Python matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Stackless Python?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Stackless Python.

Tags

  • Concurrent computing
  • Python (programming language) implementations
  • Software using the Python Software Foundation License

Keep exploring