From b18a63969c6c0ac3041afe4f4b612a1e8547bd84 Mon Sep 17 00:00:00 2001 From: Sanchi Agarwal Date: Sun, 16 Aug 2026 16:37:28 +0530 Subject: [PATCH 1/2] Fix sumset docstring --- maths/sumset.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/maths/sumset.py b/maths/sumset.py index fa18f9e24b4c..c1fc898f4217 100644 --- a/maths/sumset.py +++ b/maths/sumset.py @@ -10,10 +10,9 @@ def sumset(set_a: set, set_b: set) -> set: """ - :param first set: a set of numbers - :param second set: a set of numbers - :return: the nth number in Sylvester's sequence - + :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) >>> sumset({1, 2, 3}, {4, 5, 6}) {5, 6, 7, 8, 9} From 6e104dd8417530feff6b5af316cb7b2f06fc0fdf Mon Sep 17 00:00:00 2001 From: Sanchi Agarwal Date: Tue, 18 Aug 2026 16:39:07 +0530 Subject: [PATCH 2/2] Add empty set test for sumset --- maths/sumset.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/maths/sumset.py b/maths/sumset.py index c1fc898f4217..64af2eca88bc 100644 --- a/maths/sumset.py +++ b/maths/sumset.py @@ -23,6 +23,8 @@ def sumset(set_a: set, set_b: set) -> set: Traceback (most recent call last): ... AssertionError: The input value of [set_b=3] is not a set + >>> sumset(set(), {1, 2, 3}) + set() """ assert isinstance(set_a, set), f"The input value of [set_a={set_a}] is not a set" assert isinstance(set_b, set), f"The input value of [set_b={set_b}] is not a set"