junrushao commented on code in PR #212:
URL: https://github.com/apache/tvm-ffi/pull/212#discussion_r2482170708


##########
python/tvm_ffi/registry.py:
##########
@@ -29,7 +29,10 @@
 _SKIP_UNKNOWN_OBJECTS = False
 
 
-def register_object(type_key: str | type | None = None) -> Callable[[type], 
type] | type:
+_T = TypeVar('_T', bound=type)
+
+
+def register_object(type_key: str | type | None = None) -> Callable[[_T], _T] 
| type:

Review Comment:
   we could simplify it even more for canonical usecase, e.g.
   
   ```suggestion
   def register_object(type_key: str | None = None) -> Callable[[_T], _T]:
   ```



-- 
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]

Reply via email to