def is_file_like_obj(obj):
"""
Helper function to check that the given object implements all public methods of the
:class:`~io.IOBase` abstract class.
"""
return all((hasattr(obj, name) for name in dir(io.IOBase) if not name.startswith('_')))
评论列表
文章目录