I want to cast data like [1,2,\'a\',\'He said \"what do you mean?\"\'] to a CSV-formatted string.
[1,2,\'a\',\'He said \"what do you mean?\"\']
Normally one would use csv.writer() for
csv.writer()
You could use StringIO instead of your own Dummy_Writer:
Dummy_Writer
This module implements a file-like class, StringIO, that reads and writes a string buffer (also known as memory files).
StringIO
There is also cStringIO, which is a faster version of the StringIO class.