junrushao commented on code in PR #311:
URL: https://github.com/apache/tvm-ffi/pull/311#discussion_r2590244597


##########
python/tvm_ffi/utils/kwargs_wrapper.py:
##########
@@ -51,68 +52,72 @@ def _validate_argument_names(names: list[str], arg_type: 
str) -> None:
             raise TypeError(
                 f"{arg_type} name must be a string, got {type(name).__name__}: 
{name!r}"
             )
+        if keyword.iskeyword(name):
+            raise ValueError(
+                f"Invalid {arg_type.lower()} name: {name!r} is a Python 
keyword and cannot be used as a parameter name"
+            )

Review Comment:
   I really think it's pretty over-defensive 😂 but fine



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