Skip to content

Commit 40a200b

Browse files
committed
Refactoring. Adding the None annotation to the return value
1 parent 547f30f commit 40a200b

18 files changed

Lines changed: 39 additions & 39 deletions

‎Fibonacci number/6 ways.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def memoize(fn, arg):
6666

6767
# Example 5: Using memoization as decorator (decorator-class)
6868
class MemoizeClass:
69-
def __init__(self, func):
69+
def __init__(self, func) -> None:
7070
self.func = func
7171
self.memo = dict()
7272

‎Fibonacci number/FibonacciNumber.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
__author__ = "ipetrash"
22

33

4-
def fibo_1(n):
4+
def fibo_1(n) -> None:
55
f = [0, 1]
66
for i in range(2, n + 1):
77
f.append(f[i - 1] + f[i - 2])
88
print(f)
99

1010

11-
def fibo_2(n):
11+
def fibo_2(n) -> None:
1212
a, b = 0, 1
1313
print(a, b, end=" ")
1414
for i in range(2, n + 1):

‎fb2__parsing/extract_pictures_from_fb2/fb2_pictures__using_bs4.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from common import get_file_name_from_binary
2424

2525

26-
def do(file_name, output_dir="output", debug=True):
26+
def do(file_name, output_dir="output", debug=True) -> None:
2727
dir_fb2 = os.path.basename(file_name)
2828
dir_im = os.path.join(output_dir, dir_fb2)
2929
os.makedirs(dir_im, exist_ok=True)

‎fb2__parsing/extract_pictures_from_fb2/fb2_pictures__using_lxml.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from common import get_file_name_from_binary
2424

2525

26-
def do(file_name, output_dir="output", debug=True):
26+
def do(file_name, output_dir="output", debug=True) -> None:
2727
dir_fb2 = os.path.basename(file_name)
2828
dir_im = os.path.join(output_dir, dir_fb2)
2929
os.makedirs(dir_im, exist_ok=True)

‎fb2__parsing/extract_pictures_from_fb2/fb2_pictures__using_lxml_iterwalk.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from common import get_file_name_from_binary
2424

2525

26-
def do(file_name, output_dir="output", debug=True):
26+
def do(file_name, output_dir="output", debug=True) -> None:
2727
dir_fb2 = os.path.basename(file_name)
2828
dir_im = os.path.join(output_dir, dir_fb2)
2929
os.makedirs(dir_im, exist_ok=True)

‎fb2__parsing/extract_pictures_from_fb2/fb2_pictures__using_re.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from common import get_file_name_from_binary
2626

2727

28-
def do(file_name, output_dir="output", debug=True):
28+
def do(file_name, output_dir="output", debug=True) -> None:
2929
dir_fb2 = os.path.basename(file_name)
3030
dir_im = os.path.join(output_dir, dir_fb2)
3131
os.makedirs(dir_im, exist_ok=True)

‎fb2__parsing/extract_pictures_from_fb2/fb2_pictures__using_str_find.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def iter_blocks(text: str, start_str: str, end_str: str) -> Iterator[str]:
5454
yield block
5555

5656

57-
def do(file_name, output_dir="output", debug=True):
57+
def do(file_name, output_dir="output", debug=True) -> None:
5858
dir_fb2 = os.path.basename(file_name)
5959
dir_im = os.path.join(output_dir, dir_fb2)
6060
os.makedirs(dir_im, exist_ok=True)

‎fb2__parsing/extract_pictures_from_fb2/fb2_pictures__using_xml_etree.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from common import get_file_name_from_binary
2424

2525

26-
def do(file_name, output_dir="output", debug=True):
26+
def do(file_name, output_dir="output", debug=True) -> None:
2727
dir_fb2 = os.path.basename(file_name)
2828
dir_im = os.path.join(output_dir, dir_fb2)
2929
os.makedirs(dir_im, exist_ok=True)

‎fb2__parsing/extract_pictures_from_fb2/fb2_pictures__using_xml_etree_xpath.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from common import get_file_name_from_binary
2424

2525

26-
def do(file_name, output_dir="output", debug=True):
26+
def do(file_name, output_dir="output", debug=True) -> None:
2727
dir_fb2 = os.path.basename(file_name)
2828
dir_im = os.path.join(output_dir, dir_fb2)
2929
os.makedirs(dir_im, exist_ok=True)

‎fb2__parsing/extract_pictures_from_fb2/fb2_pictures__using_xml_expat.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from common import get_file_name_from_binary
2323

2424

25-
def do(file_name, output_dir="output", debug=True):
25+
def do(file_name, output_dir="output", debug=True) -> None:
2626
dir_fb2 = os.path.basename(file_name)
2727
dir_im = os.path.join(output_dir, dir_fb2)
2828
os.makedirs(dir_im, exist_ok=True)
@@ -36,18 +36,18 @@ def do(file_name, output_dir="output", debug=True):
3636
"number": 1,
3737
}
3838

39-
def on_start_element(name, attrs):
39+
def on_start_element(name, attrs) -> None:
4040
PARSE_DATA["last_start_tag"] = name
4141
PARSE_DATA["last_tag_attrs"] = attrs
4242
PARSE_DATA["last_tag_data"] = ""
4343

44-
def on_char_data(data):
44+
def on_char_data(data) -> None:
4545
if PARSE_DATA["last_start_tag"] != "binary":
4646
return
4747

4848
PARSE_DATA["last_tag_data"] += data
4949

50-
def on_end_element(name):
50+
def on_end_element(name) -> None:
5151
if name != "binary":
5252
return
5353

0 commit comments

Comments
 (0)