Internal working of Python

PythonServer Side ProgrammingProgramming

In this article, we will learn about the internal working of python & how different objects are allocated space in the memory by the python interpreter.

Python is an object-oriented programming construct language like Java. Python uses an interpreter and hence called an interpreted language. Python supports minimalism and modularity to increase readability and minimize time and space complexity. The standard implementation of python is called “cpython” and we can use c codes to get output in python.

Python converts the source code into a series of byte codes. So within python, compilation stage happens, but directly into byte code and this byte code can’t be identified by CPU. So there is a need for a mediator to do this task. Here an interpreter comes into existence called the python virtual machine. The python virtual machine takes care of the execution of byte codes.

Now let’s see how frames and objects are decided in python with different primitive and derived data types.

List

Tuple

Dictionary implementation

Set implementation

Class implementation

Conclusion

In this article, we learned about the internal working of Python and frames/ objects allocation in Python internally.

raja
Published on 29-Aug-2019 11:38:09
Advertisements