Skip to content

fix: no implicit optional #7984

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data_structures/binary_tree/fenwick_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class FenwickTree:
More info: https://en.wikipedia.org/wiki/Fenwick_tree
"""

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

Expand Down
2 changes: 1 addition & 1 deletion fractals/julia_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def iterate_function(
function_params: Any,
nb_iterations: int,
z_0: numpy.ndarray,
infinity: float = None,
infinity: float | None = None,
) -> numpy.ndarray:
"""
Iterate the function "eval_function" exactly nb_iterations times.
Expand Down
2 changes: 1 addition & 1 deletion linear_algebra/src/schur_complement.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def schur_complement(
mat_a: np.ndarray,
mat_b: np.ndarray,
mat_c: np.ndarray,
pseudo_inv: np.ndarray = None,
pseudo_inv: np.ndarray | None = None,
) -> np.ndarray:
"""
Schur complement of a symmetric matrix X given as a 2x2 block matrix
Expand Down
2 changes: 1 addition & 1 deletion machine_learning/linear_discriminant_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def valid_input(
input_msg: str,
err_msg: str,
condition: Callable[[num], bool] = lambda x: True,
default: str = None,
default: str | None = None,
) -> num:
"""
Ask for user value and validate that it fulfill a condition.
Expand Down
2 changes: 1 addition & 1 deletion project_euler/problem_074/sol1.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def sum_digit_factorials(n: int) -> int:
return ret


def chain_length(n: int, previous: set = None) -> int:
def chain_length(n: int, previous: set | None = None) -> int:
"""
Calculate the length of the chain of non-repeating terms starting with n.
Previous is a set containing the previous member of the chain.
Expand Down
2 changes: 1 addition & 1 deletion sorts/strand_sort.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import operator


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