junrushao commented on code in PR #35:
URL: https://github.com/apache/tvm-ffi/pull/35#discussion_r2366473744
##########
python/tvm_ffi/access_path.py:
##########
@@ -39,11 +39,30 @@ class AccessKind(IntEnum):
class AccessStep(core.Object):
"""Access step container."""
+ if TYPE_CHECKING:
+ kind: AccessKind
+ key: Any
+
@register_object("ffi.reflection.AccessPath")
class AccessPath(core.Object):
"""Access path container."""
+ if TYPE_CHECKING:
Review Comment:
ditto
[here](https://github.com/apache/tvm-ffi/pull/35#discussion_r2366472871). We
may want either a separate stub file via stub generation, or suppress type
errors
##########
python/tvm_ffi/testing.py:
##########
@@ -16,23 +16,37 @@
# under the License.
"""Testing utilities."""
-from typing import Any, ClassVar
+from typing import TYPE_CHECKING, Any, ClassVar
from . import _ffi_api
from .core import Object
from .dataclasses import c_class, field
from .registry import register_object
+if TYPE_CHECKING:
+ from tvm_ffi import Array, Map
+
@register_object("testing.TestObjectBase")
class TestObjectBase(Object):
"""Test object base class."""
+ if TYPE_CHECKING:
+ v_i64: int
+ v_f64: float
+ v_str: str
+
+ def add_i64(self, x: int) -> int: ... # noqa: D102
Review Comment:
ditto
[this](https://github.com/apache/tvm-ffi/pull/35#discussion_r2366472871)
--
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]