Skip to main content
Post Closed as "Duplicate" by Martijn Pieters python
added 177 characters in body
Source Link
Sigma
  • 38
  • 6

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 the same data it had when being an actual instance, I haven't been able to find something like an instance() function that would act similar to str() or int()

i've tried using the suggested function shown here: PYTHON : There is a function similar to ast.literal_eval ()? but it doesn't work

advice would be much appreciated

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 the same data it had when being an actual instance, I haven't been able to find something like an instance() function that would act similar to str() or int()

advice would be much appreciated

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 the same data it had when being an actual instance, I haven't been able to find something like an instance() function that would act similar to str() or int()

i've tried using the suggested function shown here: PYTHON : There is a function similar to ast.literal_eval ()? but it doesn't work

advice would be much appreciated

Source Link
Sigma
  • 38
  • 6

python convert string of instance to instance?

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 the same data it had when being an actual instance, I haven't been able to find something like an instance() function that would act similar to str() or int()

advice would be much appreciated