Skip to content

Commit 7b5a143

Browse files
committed
Add pyupgrade to pre-commit
1 parent bf6db32 commit 7b5a143

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ repos:
2222
- id: isort
2323
args:
2424
- --profile=black
25+
- repo: https://github.com/asottile/pyupgrade
26+
rev: v2.29.0
27+
hooks:
28+
- id: pyupgrade
29+
args:
30+
- --py39-plus
2531
- repo: https://gitlab.com/pycqa/flake8
2632
rev: 3.9.1
2733
hooks:

data_structures/binary_tree/merge_two_binary_trees.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __init__(self, value: int = 0) -> None:
2121
self.right: Node | None = None
2222

2323

24-
def merge_two_binary_trees(tree1: Node | None, tree2: Node | None) -> Optional[Node]:
24+
def merge_two_binary_trees(tree1: Node | None, tree2: Node | None) -> Node | None:
2525
"""
2626
Returns root node of the merged tree.
2727

data_structures/linked_list/skip_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
class Node(Generic[KT, VT]):
15-
def __init__(self, key: Union[KT, str] = "root", value: Optional[VT] = None):
15+
def __init__(self, key: KT | str = "root", value: VT | None = None):
1616
self.key = key
1717
self.value = value
1818
self.forward: list[Node[KT, VT]] = []

0 commit comments

Comments
 (0)