Random conversion to tuple

Peculiarity python in converting an element to tuple can spend several hours looking for errors.

If you accidentally put a comma at the end of a line, for example, when copying an object from somewhere in the list:

for x in data:
x[‘a’] = ‘abc’,


^ comma at the end of the line,

then this will turn the element into a tuple.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *