cara memeriksa apakah objek jenis file dalam python3

# In python3, file objects are part of the io module.
>>> from io import IOBase
>>> f = open(<filePath>, 'w')
>>> isinstance(f, IOBase)
True
>>> isinstance(object(), IOBase)
False
Debug Engineer