May-16-2020, 11:20 AM
(May-16-2020, 10:18 AM)nboogerz Wrote: Hi,Do not need to declare variables before using them in Python.
I was just wondering if 'Declaring variables' close to each other in Python scripts results in their memory location being close to each other in RAM i.e. is this an easy way to speed up Python code?
Can not choice memory location of an object in Python.
Memory Management
Memory management in Python Wrote:It is important to understand that the management of the Python heap is performed by the interpreter itself and that theuser has no control over it
,
even if they regularly manipulate object pointers to memory blocks inside that heap.
The allocation of heap space for Python objects and other internal buffers is performed on demand by the Python memory manager through the Python/C API functions listed in this document.
There are many different ways speed up Python code if that's needed,just not the way you think of with memory location.