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


##########
docs/conf.py:
##########
@@ -278,7 +278,7 @@ def _link_inherited_members(app, what, name, obj, options, 
lines) -> None:  # no
     # If it comes from builtins we already hide it; no link needed
     if base in _py_native_classes or getattr(base, "__module__", "") == 
"builtins":
         return
-    owner_fq = f"{base.__module__}.{base.__qualname__}"
+    owner_fq = 
f"{base.__module__}.{base.__qualname__}".replace("tvm_ffi.core.", "tvm_ffi.")

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   Using `str.replace()` here is a bit fragile. It could lead to incorrect 
replacements if another module path happens to contain the substring 
`"tvm_ffi.core."`. A more robust approach would be to explicitly check if the 
module name is `'tvm_ffi.core'` and then construct the fully qualified name. 
This makes the intention clearer and avoids potential side effects.
   
   ```suggestion
       owner_fq = f"{'tvm_ffi' if base.__module__ == 'tvm_ffi.core' else 
base.__module__}.{base.__qualname__}"
   ```



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