python decode ignore_我可以解码(errors =“ignore”)Python 2.7程序中所有字符串的默认值吗?...
您无法在内置类型上重新定义方法,也无法将errors参数的默认值更改为str.decode().但是,还有其他方法可以实现所需的行为.更好的方法:定义自己的decode()函数:def decode(s, encoding="ascii", errors="ignore"):return s.decode(encoding=encoding, errors=errors)现在,您将需要调用deco...