Preparation
Here, we are goint to analysis how Python deal with Int Object
in itself.
First of all, we should have a environment which help us to explore the detail of the implementation in Python 2.7
. At the same time, our operation shouldn’t influence the origianl Python in your workstation, if you have install Python before.
You can get the source code from offical website of Python. And you will find that there have a file configure
in the directory of the source.
In the file configure, you can replace all string ‘Python’ with ‘pyLab’. And then move all file prefix with Python
into pyLab
(mainly in directory Misc/ and Modules)
Don’t forget to run the configuration file – configure with the option --prefix=Location where you want the Python which is for lab to install
Finally, just run make & make install
Repeat myself again, the reason that I move all ‘Python’ into ‘pyLab’ is all for making a difference with the original instance which is official and it shouldn’t be influence by any operation from us.
Rules of Object in Python.
- Objects are structures allocated on the heap.
- Objects are never allocated statically or on the stack; they must be accessed through special macros and functions only.