gemini-code-assist[bot] commented on code in PR #491:
URL: https://github.com/apache/tvm-ffi/pull/491#discussion_r2869762078


##########
tests/python/test_object.py:
##########
@@ -137,6 +137,12 @@ def test_opaque_type_error() -> None:
 
 
 def test_object_init() -> None:
+    # Registered class with auto-generated __ffi_init__ (all fields have 
defaults)
+    obj = tvm_ffi.testing.TestObjectBase()
+    assert obj.v_i64 == 10
+    assert obj.v_f64 == 10.0
+    assert obj.v_str == "hello"
+
     # Registered class with __c_ffi_init__ should work fine
     pair = tvm_ffi.testing.TestIntPair(3, 4)  # ty: 
ignore[too-many-positional-arguments]

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   This `ty: ignore` comment appears to be a leftover and should be removed. 
The `__init__` stub for `TestIntPair` is now correctly generated, so type 
checkers shouldn't complain. A similar `ty: ignore` was removed for 
`TestIntPair` elsewhere in this file.
   
   ```suggestion
       pair = tvm_ffi.testing.TestIntPair(3, 4)
   ```



##########
examples/python_packaging/run_example.py:
##########
@@ -45,7 +45,7 @@ def run_raise_error() -> None:
 def run_int_pair() -> None:
     """Invoke IntPair from the extension to demonstrate object handling."""
     print("=========== Example 4: IntPair ===========")
-    pair = my_ffi_extension.IntPair(1, 2)
+    pair = my_ffi_extension.IntPair(1, 2)  # ty: 
ignore[too-many-positional-arguments]

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   The `ty: ignore` comment seems unnecessary here. With the new `__init__` 
stub generated for `IntPair`, type checkers should no longer complain about 
`too-many-positional-arguments`. Removing this ignore would be consistent with 
the changes in other test files where similar ignores were removed.
   
   ```suggestion
       pair = my_ffi_extension.IntPair(1, 2)
   ```



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