曾经在Python(2.6)中可以问:
isinstance(f, file)
但是在Python 3.0中file被删除了.
file
现在检查变量是否为文件的正确方法是什么?What'sNew文档没有提到这个......
python python-3.x
python ×1
python-3.x ×1