: behavior of data types and operations for mutable and immutable objects in python language The examples and explanations in this post have the following specifications: environment: vagrant virtual machine with linux 14.04.5 LTS for Ubuntu language: Python 3.6.1 (default, Nov 17 2016, 01:08:31) compiler: gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4 Python docs at docs.python.org describes: all data in a python program is represented by objects or by relations between objects. docs.python.org, further explains this concept in reference to PyObject and PyVarObject: PyObject All object types are extensions of this type. This is a type which contains the information Python needs to treat a pointer to an object as an object. In a normal “release” build, it contains only the object’s reference count and a pointer to the corresponding type object. It corresponds to the fields defined by the expansion of the PyObject_HEAD macro. PyVarObject This is an extension of PyObject that adds the ob_size field. […]
read moreTag Archives: memory
what not to do is as important as what to do
:on how and why C language allocates memory Special thanks to Lisa Leung for her editions. You can follow her on github here. In learning C language, in our studies as Software Engineering students at a bootcamp, we use the GCC (i.e. GNU Compiler Collection) compiler to convert our C language code into an executable file of code in binary system (i.e. 0’s and 1’s) because 0’s and 1’s can be easily translated into on and off transistors of a circuit board. For more on GCC compiler, check out my article: Computer Compilers: brief introduction. So, when a transistor is off, that translates to a ‘0’ (zero), and a transistor that is on (having electric current flow) translates to a ‘1’ (one). Binary is the link between human legible code and the machine that contains transistors in the Central Processing Unit or CPU. Once one has a basic grasp of this concept, it […]
read more