Linked Questions

49 votes
4 answers
29k views

Can you dereference a variable id retrieved from the id function in Python? For example: dereference(id(a)) == a I want to know from an academic standpoint; I understand that there are more practical ...
Hophat Abc's user avatar
  • 5,373
11 votes
1 answer
19k views

Possible Duplicate: Get object by id()? >>> var = 'I need to be accessed by id!' >>> address = id(var) >>> print(address) 33003240 Is there any way to use address of var ...
Gill Bates's user avatar
  • 15.5k
2 votes
3 answers
2k views

I want to get the instance of an class object. I have its address and the name of the object. How can it be possible to create the instance of the object or how can I retrieve the same object? The ...
mkreddy's user avatar
  • 163
1 vote
2 answers
2k views

A light in Maya has an attribute Use Color Temperature, which is a checkbox, when I toggle it, a function is called inside Maya to actually do the work behind the scene. Unfortunately the function ...
qurban's user avatar
  • 3,935
4 votes
0 answers
7k views

I want to access a value in memory address. Code1: value = 10 print(id(value)) >> 10894368 Code2 (I don't know how): accessValue(10894368) >> 10
Radagast's user avatar
  • 509
0 votes
1 answer
2k views

Possible Duplicate: Python: Get object by id I have a query, that is, in python if we try this >>>a=5 >>>id(a) >>>746363 that is we are getting id , it is equivalent ...
neotam's user avatar
  • 2,751
0 votes
1 answer
2k views

I would like be able to restore an object from the python id function. So something like this: a = "My random string" internal_id = id(a) b = get_object(internal_id) assert b is a Where I'm ...
Peter Mølgaard Pallesen's user avatar
0 votes
1 answer
567 views

is there any way for me to convert a string of a python instance: "<__main__.test instance at 0x0325E5D0>" to an actual instance <__main__.test instance at 0x0325E5D0> while having keep ...
Sigma's user avatar
  • 38
0 votes
2 answers
272 views

Possible Duplicate: Python: Get object by id Typically when you see the string representation of an instance it looks something like <module.space.Class @ 0x108181bc>. I am curious if it's ...
lukecampbell's user avatar
  • 15.3k
-2 votes
1 answer
354 views

I'm learning the lambda function in Python. If I write a lambda expression line without assign it to some function name, can I call that lambda function by its address in memory or id later? Or ...
Al.'s user avatar
  • 1
0 votes
0 answers
104 views

I was trying to demonstrate call by reference and value and what the address of the variable is in python: x = 10 print x 10 x = id(x) print x 3457569 I pass x to my function by reference as x ...
Timothy Lawman's user avatar
0 votes
0 answers
43 views

I'm able to get the right address of an object in Python 3. Using hex(id(Object)) class TestObject: myMemberData = 5 obj = TestObject() #Using repr print(repr(obj)) #Getting address manually! ...
O'Niel's user avatar
  • 1,683
0 votes
0 answers
25 views

import numpy as np a = np.arange(10) id(a) Here we know that id function return the identity of the object 'a'. Suppose that we only know the id of object(139806990767008 int or long), How can I get ...
Li Ziming's user avatar
  • 385
79 votes
16 answers
55k views

So I'm using Python 2.7, using the json module to encode the following data structure: 'layer1': { 'layer2': { 'layer3_1': [ long_list_of_stuff ], 'layer3_2': 'string' } } My ...
Rohaq's user avatar
  • 2,076
32 votes
4 answers
33k views

I have a Python program that runs a series of experiments, with no data intended to be stored from one test to another. My code contains a memory leak which I am completely unable to find (I've look ...
Casebash's user avatar
  • 120k

15 30 50 per page