On Tue, Jun 18, 2013 at 10:34:23PM -0700, Jim Mooney wrote:
On 18 June 2013 19:41, Steven D'Aprano st...@pearwood.info wrote:
On Tue, Jun 18, 2013 at 06:41:01PM -0700, Jim Mooney wrote:
Is there a way to unstring something? That is str(object) will give me
a string, but what if I want the
Is there a way to unstring something? That is str(object) will give me
a string, but what if I want the original object back, for some
purpose, without a lot of foofaraw?
--
Jim
After indictment the bacon smuggler was put on the no-fry list
___
Tutor
On 06/18/2013 09:41 PM, Jim Mooney wrote:
Is there a way to unstring something? That is str(object) will give me
a string, but what if I want the original object back, for some
purpose, without a lot of foofaraw?
In general, definitely not. A class can define just about anything in
its
On Tue, Jun 18, 2013 at 6:41 PM, Jim Mooney cybervigila...@gmail.comwrote:
Is there a way to unstring something? That is str(object) will give me
a string, but what if I want the original object back, for some
purpose, without a lot of foofaraw?
Unless you're storing them in a dictionary and
Jim Mooney cybervigila...@gmail.com wrote:
Is there a way to unstring something? That is str(object) will give me
a string, but what if I want the original object back, for some
purpose, without a lot of foofaraw?
Only by keeping the original reference to the object. str(object) produces a
new
On Tue, Jun 18, 2013 at 06:41:01PM -0700, Jim Mooney wrote:
Is there a way to unstring something? That is str(object) will give me
a string, but what if I want the original object back, for some
purpose, without a lot of foofaraw?
The short answer is, no.
The slightly longer answer is,
On 18 June 2013 19:41, Steven D'Aprano st...@pearwood.info wrote:
As an alternative, if you give up the requirement that the string be
human-readable, you can *serialise* the object. Not all objects can be
serialised, but most can. You can use:
- marshal
- pickle
I had a feeling it would
I believe there's a general law of physics and/or informatics at work
here...
That sounds right to me - it's some form of perpetual motion ;') And
I can see other difficulties. unstring the 5 in x = 5 and that
would work, but unstring x = Bob and Python thinks Bob is a
nonexistent variable
On 18 June 2013 19:41, Steven D'Aprano st...@pearwood.info wrote:
On Tue, Jun 18, 2013 at 06:41:01PM -0700, Jim Mooney wrote:
Is there a way to unstring something? That is str(object) will give me
a string, but what if I want the original object back, for some
purpose, without a lot of