def is_fileobj(f):
""" Check if an object `f` is intance of FileIO object created
by `open()`"""
return isinstance(f, io.TextIOBase) or \
isinstance(f, io.BufferedIOBase) or \
isinstance(f, io.RawIOBase) or \
isinstance(f, io.IOBase)
评论列表
文章目录