Ubospica commented on code in PR #608:
URL: https://github.com/apache/tvm-ffi/pull/608#discussion_r3397978411
##########
python/tvm_ffi/stub/file_utils.py:
##########
@@ -126,6 +130,7 @@ class FileInfo:
path: Path
lines: tuple[str, ...]
code_blocks: list[CodeBlock]
+ syntax: C.MarkerSyntax = dataclasses.field(default=C.PYTHON_SYNTAX)
Review Comment:
same
##########
python/tvm_ffi/stub/python_generator/codegen.py:
##########
@@ -288,28 +351,30 @@ def generate_ffi_api(
# Import parent type keys if they are not defined in the current module
if parent_type_key and parent_type_key not in defined_type_keys:
parent_type_name = "_" + parent_type_key.replace(".", "_")
- append += C._prompt_import_object(parent_type_key,
parent_type_name)
+ append += _prompt_import_object(parent_type_key, parent_type_name,
syntax)
# Generate class definition
- append += C._prompt_class_def(
+ append += _prompt_class_def(
type_name,
type_key,
parent_type_name,
+ syntax,
)
# Part 4. __all__
if not any(code.kind == "__all__" for code in code_blocks):
- append += C.PROMPT_ALL_SECTION
+ append += _prompt_all_section(syntax)
return append
-def generate_init(
+def generate_python_init(
code_blocks: list[CodeBlock],
module_name: str,
submodule: str = "_ffi_api",
+ syntax: C.MarkerSyntax = C.PYTHON_SYNTAX,
Review Comment:
```suggestion
```
We don't need to specify syntax here
--
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]