Skip to content

Commit 7447964

Browse files
committed
cuda_core: clarify enum explanation helper docs
Clarify that DocstringBackedExplanations is a compatibility shim for the existing ``.get(int(error))`` lookup shape, and trim a low-value implementation note from the docstring cleanup workaround comment. Made-with: Cursor
1 parent 4fde3d6 commit 7447964

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

cuda_core/cuda/core/_utils/enum_explanations_helpers.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ def clean_enum_member_docstring(doc: str | None) -> str | None:
6969
return None
7070
s = doc
7171
# Known codegen bug on cudaErrorIncompatibleDriverContext. Remove once fixed
72-
# in cuda-bindings code generation. Do not use a raw string for the needle:
73-
# r"\n..." would not match the real newline present in __doc__.
72+
# in cuda-bindings code generation.
7473
s = s.replace("\n:py:obj:`~.Interactions`", ' "Interactions ')
7574
s = re.sub(
7675
r":(?:py:)?(?:obj|func|meth|class|mod|data|const|exc):`([^`]+)`",
@@ -85,11 +84,9 @@ def clean_enum_member_docstring(doc: str | None) -> str | None:
8584

8685

8786
class DocstringBackedExplanations:
88-
"""``dict.get``-like lookup over enum-member ``__doc__`` strings.
87+
"""Compatibility shim exposing enum-member ``__doc__`` text via ``dict.get``.
8988
90-
Once the bindings-version gate says docstrings are available, use them
91-
exclusively. Missing docstrings should surface as ``None`` / ``default``
92-
rather than silently mixing in frozen fallback prose.
89+
Keeps the existing ``.get(int(error))`` lookup shape used by ``cuda_utils.pyx``.
9390
"""
9491

9592
__slots__ = ("_enum_type",)

0 commit comments

Comments
 (0)