junrushao opened a new pull request, #508:
URL: https://github.com/apache/tvm-ffi/pull/508

   ## Summary
   
   - Extend `@py_class` to detect and register recognized FFI dunder methods 
(`__ffi_repr__`, `__ffi_eq__`, `__s_equal__`, etc.) defined on Python 
dataclasses, making them callable from C++ and other FFI languages
   - `_FFI_RECOGNIZED_METHODS` allowlist in `py_class.py` gates which dunders 
are collected; `_collect_py_methods()` scans class dict and 
`TypeInfo._register_py_methods()` registers via the C API 
(`TVMFFITypeRegisterMethod` + `TVMFFITypeRegisterAttr`)
   - No C++ changes — `dataclass.cc` is unmodified from upstream
   
   ## Test plan
   
   - [x] 12 new dedicated tests covering allowlist filtering, registration, 
round-trip dispatch (repr, eq, compare, hash)
   - [x] All 590 existing tests in affected test files pass 
(`test_dataclass_py_class`, `test_dataclass_repr`, `test_dataclass_compare`, 
`test_dataclass_hash`)
   - [ ] CI: lint, C++ tests, Python tests, Rust tests
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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]

Reply via email to