Skip to content

dr4ke616/custom_python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom Python

Experimenting and messing with Python (v2.7) source code, inspired by two blog posts, Replacing import with accio: A Dive into Bootstrapping and Python's Grammar and Python internals: adding a new statement to Python.

First step is to clone and install. Details as to why we need this intermediary version of Python can be read in this article

git clone git@github.com:dr4ke616/custom_python.git
cd intermediary_python/
./configure --with-pydebug
make clean && make -s -j2
cd bin/
export PATH=`pwd`:$PATH

Now we go to the my_python directory and install the new version

cd ../../my_python
./configure --with-pydebug
make clean && make -s -j2
cd bin/
export PATH=`pwd`:$PATH
cd ../../

We can test now with:

python test_custom_python.py

Replace print with shout:

>>> print "hello"
  File "<stdin>", line 1
    print 'hello'
                ^
SyntaxError: invalid syntax

>>> shout 'hello'
hello

Checkout test_custom_python.py for some more examples

About

Experimental Python builds

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published