in dump method, print => (fp=sys.stdout).write
str.format is recommended after ver3.0
ex) "%s" % v => "{0}".format(v)