Skip to content

Commit b8eded2

Browse files
committed
Align version directive helper signatures
1. Review finding: the documented versionadded and versionchanged examples passed the version as a positional argument, but the helper signatures treated that positional argument as the reason, causing versionadded to raise ValueError and versionchanged to conflict with reason=.\n\n2. Suggested fix implemented in this commit: change versionadded and versionchanged to accept version as the first positional parameter while preserving the existing keyword-based call sites used by the PR.
1 parent d0606ff commit b8eded2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • cuda_core/cuda/core/_vendored/deprecated

‎cuda_core/cuda/core/_vendored/deprecated/sphinx.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def get_deprecated_msg(self, wrapped, instance):
7676
return msg
7777

7878

79-
def versionadded(reason="", version="", line_length=70):
79+
def versionadded(version, reason="", line_length=70):
8080
"""
8181
Decorator that inserts a "versionadded" Sphinx directive into the docstring.
8282
"""
@@ -88,7 +88,7 @@ def versionadded(reason="", version="", line_length=70):
8888
)
8989

9090

91-
def versionchanged(reason="", version="", line_length=70):
91+
def versionchanged(version, reason="", line_length=70):
9292
"""
9393
Decorator that inserts a "versionchanged" Sphinx directive into the docstring.
9494
"""

0 commit comments

Comments
 (0)