Skip to content

Fix docstring copy-paste error in maths/sumset.py - #15052

Open
satyamkumar-builds wants to merge 1 commit into
TheAlgorithms:masterfrom
satyamkumar-builds:fix/15013-sumset-docstring
Open

Fix docstring copy-paste error in maths/sumset.py#15052
satyamkumar-builds wants to merge 1 commit into
TheAlgorithms:masterfrom
satyamkumar-builds:fix/15013-sumset-docstring

Conversation

@satyamkumar-builds

Copy link
Copy Markdown

Describe your change:

The docstring of sumset() in maths/sumset.py contained a copy-paste error from maths/sylvester_sequence.py:

  • The return description said "the nth number in Sylvester's sequence" — but the function computes a sumset, a completely different mathematical concept.
  • The param names (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:

:param set_a: a set of numbers
:param set_b: a set of numbers
:return: the sumset of set_a and set_b (all pairwise sums a + b)

No code logic changed — documentation fix only. All existing doctests pass.

Fixes #15013

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Does your submission pass tests?   (documentation only change; doctests pass locally)

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
@algorithms-keeper algorithms-keeper Bot added enhancement This PR modified some existing files awaiting reviews This PR is ready to be reviewed labels Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: maths/sumset.py docstring incorrectly references Sylvester's sequence

2 participants