You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cuda_core/AGENTS.md
+1-5Lines changed: 1 addition & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,11 +125,7 @@ Python or Cython type annotations should be included for all public APIs. Avoid
125
125
the use of `Any` unless absolutely necessary. The argument and return types as
126
126
defined in the docstrings should match the type annotations.
127
127
128
-
The use of `if typing.TYPE_CHECK:` blocks is often necessary to avoid import
129
-
cycles. However, this can occasionally mask symbols used by Sphinx to make
130
-
cross-references in the docs. If importing an object doesn't create a cycle, it
131
-
should be imported outside of an `if typing.TYPE_CHECK:` block, even if it is
132
-
only used in type annotations.
128
+
Python imports should generally be outside of an if typing.TYPE_CHECK: block, even if the imported object is only used in type annotations. Use if typing.TYPE_CHECK: only to avoid creating import cycles. (This guidance maximizes compatibility with the cross-reference mechanisms in Sphinx.)
0 commit comments