Skip to content

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

Description

@eajajhossain

Repository commit

a0b0f41

Python version (python --version)

Python 3.13

Dependencies version (pip freeze)

No dependencies required (this is a documentation bug)

Expected behavior

Expected behaviour-
The docstring of the sumset() function in maths/sumset.py should correctly describe what the function returns , the sumset of two input sets (all pairwise sums).

additional information -
The bug is in line 8 of maths/sumset.py.

Current (wrong):
:param first set: a set of numbers
:param second set: a set of numbers
:return: the nth number in Sylvester's sequence

Should be:
: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)

This appears to be a copy-paste error from maths/sylvester_sequence.py.

Actual behavior

The docstring contains a copy-paste error. The :return: line says:

:return: the nth number in Sylvester's sequence

But the function computes a sumset, not Sylvester's sequence. These are completely different mathematical concepts.

Additionally, the :param names (first set, second set) don't match the actual parameter names (set_a, set_b).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions