1

In the Interactive Data Language (IDL) there is the function TEMPORARY:

https://www.harrisgeospatial.com/docs/TEMPORARY.html

This function allows things like the following:

A = TEMPORARY(B)

Which copies the information from B into A without doubling the used memory. That is, if A amounts to 1GB of RAM, the task above does not need a computer with 2GB of RAM and it can be executed in a computer with 1GB of RAM.

I was wondering if such a function exists in Python.

Stefano
  • 359
  • 1
  • 5
  • 16
  • 1
    So `B` is a reference to `A` - or is there something like copy-on-write? – rdas Apr 23 '19 at 13:03
  • 1
    The exact semantics of `TEMPORARY()` are fundamentally impossible to duplicate in Python, as it involves changing the value of the variable passed to it. In Python, only *values* are ever passed to functions, there is no access to the variable that value came from (assuming that it even did come from a variable, rather than something like a literal or an expression). – jasonharper Apr 23 '19 at 13:11

0 Answers0