📜  <type 'file'>python3 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:34.795000             🧑  作者: Mango

代码示例1
# In python3, builtin file is no more present. 
# In python3, file objects are part of the io module. You can do it something like this.
>>> from io import IOBase
>>> f = open(, 'w')
>>> isinstance(f, IOBase)
True
>>> isinstance(object(), IOBase)
False