junrushao opened a new pull request, #498: URL: https://github.com/apache/tvm-ffi/pull/498
## Summary - Remove `__instancecheck__` and `__subclasscheck__` from `_ObjectSlotsMeta` in `python/tvm_ffi/cython/object.pxi`. These methods unconditionally returned `True` for any `CObject` instance/subclass regardless of which class was being checked, causing incorrect behavior (e.g., `isinstance(Map(...), Array)` returning `True`). - The methods are unnecessary because all objects returned from C++ are always constructed as proper `Object` subclasses, so standard Python MRO-based `isinstance`/`issubclass` checks work correctly. - Update `test_dataclass_init.py` to assert correct behavior (parent is not an instance of child). - Add 22 new regression tests in `TestIsinstanceIssubclass` covering containers, inheritance, and cross-hierarchy `isinstance`/`issubclass` checks. ## Test plan - [x] All 1517 existing Python tests pass - [x] 22 new tests verify correct isinstance/issubclass behavior for containers (Array, List, Map, Dict), inheritance hierarchies, and cross-hierarchy checks - [x] Pre-commit hooks pass (ruff, cython-lint, ty, etc.) 🤖 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]
