python backward compatible string creation