Skip to content

Commit 54f6d1f

Browse files
authored
Merge pull request #241 from cclauss/patch-1
noqa to silence flake8 on Python 3 only syntax
2 parents bfd52df + 3f6760e commit 54f6d1f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Diff for: data_structures/Trie/Trie.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def __init__(self):
1212
self.nodes = dict() # Mapping from char to TrieNode
1313
self.is_leaf = False
1414

15-
def insert_many(self, words: [str]):
15+
def insert_many(self, words: [str]): # noqa: F821 This syntax is Python 3 only
1616
"""
1717
Inserts a list of words into the Trie
1818
:param words: list of string words
@@ -21,7 +21,7 @@ def insert_many(self, words: [str]):
2121
for word in words:
2222
self.insert(word)
2323

24-
def insert(self, word: str):
24+
def insert(self, word: str): # noqa: F821 This syntax is Python 3 only
2525
"""
2626
Inserts a word into the Trie
2727
:param word: word to be inserted
@@ -34,7 +34,7 @@ def insert(self, word: str):
3434
curr = curr.nodes[char]
3535
curr.is_leaf = True
3636

37-
def find(self, word: str) -> bool:
37+
def find(self, word: str) -> bool: # noqa: F821 This syntax is Python 3 only
3838
"""
3939
Tries to find word in a Trie
4040
:param word: word to look for
@@ -48,7 +48,7 @@ def find(self, word: str) -> bool:
4848
return curr.is_leaf
4949

5050

51-
def print_words(node: TrieNode, word: str):
51+
def print_words(node: TrieNode, word: str): # noqa: F821 This syntax is Python 3 only
5252
"""
5353
Prints all the words in a Trie
5454
:param node: root node of Trie

Diff for: dynamic_programming/fastfibonacci.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77

88

99
# returns F(n)
10-
def fibonacci(n: int):
10+
def fibonacci(n: int): # noqa: F821 This syntax is Python 3 only
1111
if n < 0:
1212
raise ValueError("Negative arguments are not supported")
1313
return _fib(n)[0]
1414

1515

1616
# returns (F(n), F(n-1))
17-
def _fib(n: int):
17+
def _fib(n: int): # noqa: F821 This syntax is Python 3 only
1818
if n == 0:
1919
# (F(0), F(1))
2020
return (0, 1)

0 commit comments

Comments
 (0)