True if file supports random-access.
(self)
| 1816 | super().close() |
| 1817 | |
| 1818 | def seekable(self): |
| 1819 | """True if file supports random-access.""" |
| 1820 | self._checkClosed() |
| 1821 | if self._seekable is None: |
| 1822 | try: |
| 1823 | self.tell() |
| 1824 | except OSError: |
| 1825 | self._seekable = False |
| 1826 | else: |
| 1827 | self._seekable = True |
| 1828 | return self._seekable |
| 1829 | |
| 1830 | def readable(self): |
| 1831 | """True if file was opened in a read mode.""" |