Fix docstring copy-paste error in maths/sumset.py - #15052
Conversation
The docstring incorrectly referenced Sylvester's sequence (a copy-paste error from maths/sylvester_sequence.py) and used param names that did not match the actual function signature. Fixes TheAlgorithms#15013
priya-sundaram-dev
left a comment
There was a problem hiding this comment.
LGTM — correct fix. The old :param first set: / :param second set: didn't match the real parameter names (set_a, set_b), and the :return: was copy-pasted from sylvester_sequence.py ("nth number in Sylvester's sequence") which has nothing to do with a sumset. The new text accurately describes the pairwise-sum set, and the existing doctests already cover behavior. Small, clean docs correction — thanks @satyamkumar-builds. 🤖 #ABotWroteThis
priya-sundaram-dev
left a comment
There was a problem hiding this comment.
Approving. The old docstring was a copy-paste from a Sylvester's-sequence function and didn't match the code. The new :param set_a/:param set_b names line up with the actual signature, and the sumset of set_a and set_b (all pairwise sums a + b) correctly describes the behaviour — confirmed by the existing doctests ({1,2,3}+{4,5,6} → {5,6,7,8,9}). Docs-only, no behaviour change. LGTM. 👍
Describe your change:
The docstring of
sumset()inmaths/sumset.pycontained a copy-paste error frommaths/sylvester_sequence.py:returndescription said "the nth number in Sylvester's sequence" — but the function computes a sumset, a completely different mathematical concept.paramnames (first set,second set) did not match the actual parameter names (set_a,set_b).Fixed both so the docstring now accurately describes the parameters and the return value:
No code logic changed — documentation fix only. All existing doctests pass.
Fixes #15013