I think actually ``str(i)`` here should be replaced with ``repr(i)``