代码:
import pickle
test = 3
>>> with open('test', 'wb') as file:
... pickle.dumps(test, file)
并且意外报告了错误。
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
TypeError: an integer is required (got type _io.BufferedWriter)
这里发生了什么事情?