junrushao commented on code in PR #52:
URL: https://github.com/apache/tvm-ffi/pull/52#discussion_r2374462373
##########
python/tvm_ffi/dataclasses/field.py:
##########
@@ -72,6 +75,19 @@ def field(
A zero-argument callable that produces the default. This matches the
semantics of :func:`dataclasses.field` and is useful for mutable
defaults such as ``list`` or ``dict``.
+ init : bool, default True
+ If ``True`` the field is included in the generated ``__init__``.
+ If ``False`` the field is omitted from input arguments of ``__init__``.
+
+ Note
+ ----
+ Only at most one of ``default`` or ``default_factory`` may be given.
+
+ If ``default`` or ``default_factory`` is given, or ``init=True``, the field
+ will be forwarded to the C++ ``__ffi_init__`` constructor. In case where
+ ``init=False``, but a default factory is given, the initial value is still
+ computed via the factory, and forwarded to the C++ side, but the user
cannot
+ feed its value via ``__init__``.
Review Comment:
/gemini Help me draft a better docstring
--
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]