Stringified list back to list of ints

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Wed Dec 12 19:34:46 EST 2007


On Wed, 12 Dec 2007 10:38:56 -0500, Calvin Spealman wrote:

> I still hold my vote that if you need to reverse the "stringification"
> of a list, you shouldn't have stringified the list and lost hold of the
> original list in the first place. That is the solution above all others.

Naturally, but it isn't always an option. Perhaps the list was read from 
a human-writable config file or something. It's a non-starter to expect 
people to write a list of ints in Python's native binary format -- and 
you still have the problem of how do you get those bytes from the file 
into Python's virtual machine and correctly bound to a name.


-- 
Steven.



More information about the Python-list mailing list