Ubospica commented on PR #642: URL: https://github.com/apache/tvm-ffi/pull/642#issuecomment-4780156570
Addressed the Gemini comments in db208dc: - Added `Bytes.__reduce_ex__` so pickling `tvm_ffi.core.Bytes` only persists the Python `bytes` payload and drops `_tvm_ffi_cached_object` on unpickle. - Added a regression test for cached FFI `Bytes` returned by `testing.echo`. - Kept `Bytes.__slots__` unchanged because Python raises `TypeError: nonempty __slots__ not supported for subtype of 'bytes'`; the reduction hook is sufficient to avoid serializing the cached FFI object. Local validation: - `uv pip install --reinstall --verbose . && .venv/bin/pytest -vvs tests/python/test_string.py` - commit hooks passed after fixing the local pre-commit cache dependency versions for mypy (`numpy<2.0`, `pytest<8`) to match the repo's Python 3.9 mypy target. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
