assert a as List == ['a', 2, 'c', false]["\n", "a", " ", "a", "s", " ", "L", "i", "s", "t", " ", ":", " ", "{", "\"", "a", "\"", ",", " ", "2", ",", " ", "\"", "f", "o", "o", "\"", ",", " ", "f", "a", "l", "s", "e", "}"] I added parentheses around the "a as List" and got what I expected : a as List : ["a", 2, "foo", false] Simple lesson : pay attention to precedence! That or drink coffee first thing in the morning.
so that I ended up with :
print "\na as List : " + a as List
The result wasn't what I expected :
Also, turning the whole string into a list that easily is cool.
Blogged with the Flock Browser
No comments:
Post a Comment