Coverage for src / pkg_test_dprohe / extras / extras_1.py: 64%

11 statements  

« prev     ^ index     » next       coverage.py v7.13.4, created at 2026-02-15 20:52 +0000

1""" 

2Docstring for src.pkg_test_dprohe.extras.extras_1 

3""" 

4 

5from ..core.core_1 import add, subtract 

6 

7 

8class Adder: 

9 """ 

10 Docstring for Adder 

11 """ 

12 

13 def __init__(self, value: int | float | complex): 

14 """Create an adder class that a specific value to numbers 

15 

16 Parameters 

17 ---------- 

18 value : int | float | complex 

19 A value that will be added to any input 

20 """ 

21 self.value = value 

22 

23 def add(self, value: int | float | complex): 

24 """Adds a value 

25 

26 Parameters 

27 ---------- 

28 value : int | float | complex 

29 A value to add to 

30 

31 Returns 

32 ------- 

33 sum : int | float | complex 

34 The addition of the two values 

35 """ 

36 return add(self.value, value) 

37 

38 

39class Subtractor: 

40 """ 

41 Docstring for Subtractor 

42 """ 

43 

44 def __init__(self, value: int | float | complex): 

45 """Create an subtractor class that subtracts specific value from numbers 

46 

47 Parameters 

48 ---------- 

49 value : int | float | complex 

50 A value that will be subtracted from any input 

51 """ 

52 self.value = value 

53 

54 def subtract(self, value: int | float | complex): 

55 """Subtracts a value 

56 

57 Parameters 

58 ---------- 

59 value : int | float | complex 

60 A value to subtract from 

61 

62 Returns 

63 ------- 

64 difference : int | float | complex 

65 The subtraction of the two values 

66 """ 

67 return subtract(value, self.value)