1# In python3, builtin file is no more present.
2# In python3, file objects are part of the io module. You can do it something like this.
3>>> from io import IOBase
4>>> f = open(<filePath>, 'w')
5>>> isinstance(f, IOBase)
6True
7>>> isinstance(object(), IOBase)
8False
9