Is there a module that allows me to find errors that occur due to copy
by reference? I am looking for something like the following:
Traceback (most recent call last):
File "<stdin>", line 1, in ?
CopyByReference Error: Variable b refers to variable a, so please do not
change variable a.
Does such a module exist?
Would it be possible to code such a module?
Would it be possible to add the functionality to array-copying in
numpy?
What would be the extra cost in terms of memory and CPU power?
I realize that this module would disable some useful features of the
language. On the other hand it could be helpful for new python users.
Niels
by reference? I am looking for something like the following:
>>import mydebug
>>mydebug.check copybyreference = True
>>a=2
>>b=[a]
>>a=4
>>mydebug.check copybyreference = True
>>a=2
>>b=[a]
>>a=4
File "<stdin>", line 1, in ?
CopyByReference Error: Variable b refers to variable a, so please do not
change variable a.
Does such a module exist?
Would it be possible to code such a module?
Would it be possible to add the functionality to array-copying in
numpy?
What would be the extra cost in terms of memory and CPU power?
I realize that this module would disable some useful features of the
language. On the other hand it could be helpful for new python users.
Niels
Comment