[Python-ideas] Framework for Python for CS101

Steven D'Aprano steve at pearwood.info
Wed May 27 00:41:46 CEST 2015


On Tue, May 26, 2015 at 01:19:59PM -0500, Wes Turner wrote:

> Ways to teach Python from first principles:

Most of these methods fail to teach *Python*. They teach something 
similar, but different to, Python: almost-Python.

If Rustom wishes to fork Python to create his own version of almost- 
Python, he doesn't need to discuss it here. I'd rather he didn't discuss 
it here -- this is PYTHON-ideas, not Cobra-ideas, or Lua-ideas, or 
Rustom's-purely-functional-almost-python-ideas.

There is, or at least was, a strong tradition of creating specialist 
teaching languages, starting with Pascal which developed as a more 
restricted and more pure form of Algol. But this is not the place to 
discuss it.


> * Restrict the syntactical token list ("switch features on and off")
>   * Fork Python
>   * RPython -- https://rpython.readthedocs.org/en/latest/

I'm pretty sure that RPython is not designed as a teaching language. The 
PyPy guys are fairly insistent that RPython is not a general purpose 
language, but exists for one reason and one reason only: building 
compilers.


>   * https://pypi.python.org/pypi/RestrictedPython
>   * http://pyvideo.org/video/2585/building-and-breaking-a-python-sandbox
>   * OR: execute code in container (e.g. LXC, LXD, Docker (JupyterHub);
> virtualization)

Sandboxing Python and restricting the functionality of almost-Python are 
unrelated issues. Purely functional almost-Python would want to replace 
things like dict.update which modifies the dict in place with a built-in 
function which returns a new, updated, dict. Running regular Python in a 
container doesn't make it almost-Python, it is still regular Python.


-- 
Steve


More information about the Python-ideas mailing list