Nested string substitution bug?
Posted: Thu Jan 01, 2009 6:59 am
- Code: Select all
dict={'a1':'b'}
list=['a']
print dict['[list[0]]1'] # prints 'b'
print '[dict['[list[0]]1']]' # gives compiler error: Expecting more string contents or the end of string after the bracketed expression.
Now, I know what I want the second print statement to do. Is the fact that it doesn't do what I want a bug or a feature?