When the replace got assigned to the list it got converted to a tuple inside the list and a number got added as a second item in each tuple.
For example:
['thing1', 'thing2', 'thing3'] # would be converted to
[('thing1', 1), ('thing2', 1), ('thing3', 1)]
# so basically this
things = ['thing1', 'thing2', 'thing3']
i = 0
while i < len(things)
thingies.append(re.sub('thing', 'a thing', things[i]))
i += 1
print "".join(thingies) # shows error because [('thing1', 1), ('thing2', 1), ('thing3', 1)]
The code above is just a quick summary of what's going on.
I just want to know how those tuples with ones are being added, and how to prevent it if there is a way.
Whatcha think?
Unless this is normal.
This post has been edited by hiddenghost: 25 November 2011 - 10:04 PM

New Topic/Question
Reply




MultiQuote





|