Skip to content

Commit 3bf86b9

Browse files
authored
fix: no implicit optional (TheAlgorithms#7984)
1 parent 316e71b commit 3bf86b9

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

data_structures/binary_tree/fenwick_tree.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class FenwickTree:
88
More info: https://en.wikipedia.org/wiki/Fenwick_tree
99
"""
1010

11-
def __init__(self, arr: list[int] = None, size: int = None) -> None:
11+
def __init__(self, arr: list[int] | None = None, size: int | None = None) -> None:
1212
"""
1313
Constructor for the Fenwick tree
1414

fractals/julia_sets.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def iterate_function(
8989
function_params: Any,
9090
nb_iterations: int,
9191
z_0: numpy.ndarray,
92-
infinity: float = None,
92+
infinity: float | None = None,
9393
) -> numpy.ndarray:
9494
"""
9595
Iterate the function "eval_function" exactly nb_iterations times.

linear_algebra/src/schur_complement.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def schur_complement(
77
mat_a: np.ndarray,
88
mat_b: np.ndarray,
99
mat_c: np.ndarray,
10-
pseudo_inv: np.ndarray = None,
10+
pseudo_inv: np.ndarray | None = None,
1111
) -> np.ndarray:
1212
"""
1313
Schur complement of a symmetric matrix X given as a 2x2 block matrix

machine_learning/linear_discriminant_analysis.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def valid_input(
256256
input_msg: str,
257257
err_msg: str,
258258
condition: Callable[[num], bool] = lambda x: True,
259-
default: str = None,
259+
default: str | None = None,
260260
) -> num:
261261
"""
262262
Ask for user value and validate that it fulfill a condition.

project_euler/problem_074/sol1.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def sum_digit_factorials(n: int) -> int:
7171
return ret
7272

7373

74-
def chain_length(n: int, previous: set = None) -> int:
74+
def chain_length(n: int, previous: set | None = None) -> int:
7575
"""
7676
Calculate the length of the chain of non-repeating terms starting with n.
7777
Previous is a set containing the previous member of the chain.

sorts/strand_sort.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import operator
22

33

4-
def strand_sort(arr: list, reverse: bool = False, solution: list = None) -> list:
4+
def strand_sort(arr: list, reverse: bool = False, solution: list | None = None) -> list:
55
"""
66
Strand sort implementation
77
source: https://en.wikipedia.org/wiki/Strand_sort

0 commit comments

Comments
 (0)