Skip to content

Commit

Permalink
Add closed to NativeFile and Doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
milesgranger committed Aug 23, 2022
1 parent ae55f75 commit 889881e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions python/pyarrow/io.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ cdef class NativeFile(_Weakrefable):
def __repr__(self):
name = f"pyarrow.{self.__class__.__name__}"
return (f"<{name} "
f"closed={self.closed} "
f"own_file={self.own_file} "
f"is_seekable={self.is_seekable} "
f"is_writable={self.is_writable} "
Expand Down Expand Up @@ -774,6 +775,13 @@ cdef class PythonFile(NativeFile):
As a downside, there is a non-zero redirection cost in translating
Arrow stream calls to Python method calls. Furthermore, Python's
Global Interpreter Lock may limit parallelism in some situations.
Examples
--------
>>> import io
>>> import pyarrow as pa
>>> pa.PythonFile(io.BytesIO())
<pyarrow.PythonFile closed=False own_file=False is_seekable=False is_writable=True is_readable=False>
"""
cdef:
object handle
Expand Down

0 comments on commit 889881e

Please sign in to comment.