mirror of
https://github.com/ml-explore/mlx.git
synced 2025-09-03 22:34:43 +08:00
fail early if readinto does not exist (#221)
This commit is contained in:
@@ -26,7 +26,7 @@ using namespace mlx::core;
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool is_istream_object(const py::object& file) {
|
||||
return py::hasattr(file, "read") && py::hasattr(file, "seek") &&
|
||||
return py::hasattr(file, "readinto") && py::hasattr(file, "seek") &&
|
||||
py::hasattr(file, "tell") && py::hasattr(file, "closed");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user