yaoyaoding commented on code in PR #52:
URL: https://github.com/apache/tvm-ffi/pull/52#discussion_r2376726734
##########
python/tvm_ffi/dataclasses/field.py:
##########
@@ -37,23 +37,26 @@ class Field:
way the decorator understands.
"""
- __slots__ = ("default_factory", "name")
+ __slots__ = ("default_factory", "init", "name")
def __init__(
self,
*,
name: str | None = None,
default_factory: Callable[[], _FieldValue] | _MISSING_TYPE = MISSING,
+ init: bool = True,
) -> None:
"""Do not call directly; use :func:`field` instead."""
self.name = name
self.default_factory = default_factory
+ self.init = init
def field(
*,
default: _FieldValue | _MISSING_TYPE = MISSING, # type: ignore[assignment]
default_factory: Callable[[], _FieldValue] | _MISSING_TYPE = MISSING, #
type: ignore[assignment]
+ init: bool = True,
) -> _FieldValue:
Review Comment:
You can try adding the following line
```
autodoc_typehints = 'description'
```
to `conf.py`, which does not show typehint in the signature, and only show
it in description.
See:
https://github.com/hidet-org/hidet/blob/main/docs/source/conf.py#L92C1-L92C18
and what it looks like
https://hidet.org/docs/stable/python_api/drivers.html#hidet.drivers.build_ir_module
--
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]