Blackbird wrote:
> a  = 'something'
> b = ('%r'%a)
> eval(b) == a
> 
> that in general should return True.  I hope.  But I'm sure there are
> counterexamples to that, too.

Provided 'something' is a string, that should be true, as should the 
simpler statement a == eval(repr(a))  (since '%r' is just a more complex 
way of getting the same thing as repr()).

On the other hand, if 'something' is actually some arbitrary object, 
then it's definitely not always true, especially for anything not built 
in to Python.

-Peter

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to