tqchen commented on code in PR #35:
URL: https://github.com/apache/tvm-ffi/pull/35#discussion_r2366514645
##########
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:
does type annocation have to be conditioned on TYPE_CHECKING? i feel we
should be fine without such condition?
--
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]