Last active
May 23, 2019 07:33
-
-
Save Kroisse/e28b435e085ab5348ab81ee2dddd99a2 to your computer and use it in GitHub Desktop.
io
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> f = open('setup.py') | |
>>> f | |
<_io.TextIOWrapper name='setup.py' mode='r' encoding='UTF-8'> | |
>>> import io | |
>>> isinstance(f, io.TextIOBase) | |
True | |
>>> isinstance(f, io.BufferedIOBase) | |
False | |
>>> isinstance(f, io.RawIOBase) | |
False | |
>>> f = open('setup.py', 'rb') | |
>>> f | |
<_io.BufferedReader name='setup.py'> | |
>>> isinstance(f, io.TextIOBase) | |
False | |
>>> isinstance(f, io.BufferedIOBase) | |
True | |
>>> isinstance(f, io.RawIOBase) | |
False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment