paleolimbot commented on code in PR #396:
URL: https://github.com/apache/arrow-nanoarrow/pull/396#discussion_r1519678676
##########
python/src/nanoarrow/_ipc_lib.pyx:
##########
@@ -50,22 +50,32 @@ cdef extern from "nanoarrow_ipc.h" nogil:
cdef class PyInputStreamPrivate:
- cdef object obj
- cdef object obj_method
- cdef void* addr
- cdef Py_ssize_t size_bytes
- cdef int close_stream
+ cdef object _obj
+ cdef bint _close_stream
+ cdef void* _addr
+ cdef Py_ssize_t _size_bytes
def __cinit__(self, obj, close_stream=False):
- self.obj = obj
- self.obj_method = obj.readinto
- self.addr = NULL
- self.size_bytes = 0
- self.close_stream = close_stream
+ self._obj = obj
+ self._close_stream = close_stream
+ self._addr = NULL
+ self._size_bytes = 0
+
+ @property
+ def obj(self):
+ return self._obj
+
+ @property
+ def close_stream(self):
Review Comment:
It currently only closes a file object if the higher level Python wrapping
this was the code that opened it (e.g., it won't close a connection that a user
opened in case the user had other plans or the IPC data was only part of the
file payload).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]