Skip to content

Commit 605eec8

Browse files
committed
Refactoring. Adding the None annotation to the return value
1 parent fa2b911 commit 605eec8

4 files changed

Lines changed: 13 additions & 13 deletions

File tree

‎inspect__examples/check_is_empty_function__use__inspect__dis.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
from inspect__get_source__function import check_is_empty_function as check_is_empty_function__use_inspect
99

1010

11-
def foo():
11+
def foo() -> None:
1212
pass
1313

1414

15-
def foo2():
15+
def foo2() -> int:
1616
return 1
1717

1818

‎inspect__examples/inspect__get_source__function.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ def check_is_empty_function(function):
1414

1515
if __name__ == "__main__":
1616

17-
def foo():
17+
def foo() -> None:
1818
pass
1919

20-
def foo2():
20+
def foo2() -> int:
2121
return 1
2222

2323
print("Empty:", check_is_empty_function(foo))

‎inspect__examples/is_function.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99

1010

11-
def foo():
11+
def foo() -> int:
1212
return 1
1313

1414

1515
class Foo:
16-
def __call__(self):
16+
def __call__(self) -> int:
1717
return 1
1818

1919

‎jazzcinema_ru/show_schedule_gui/main.py‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from qtpy.QtCore import *
2222

2323

24-
def log_uncaught_exceptions(ex_cls, ex, tb):
24+
def log_uncaught_exceptions(ex_cls, ex, tb) -> None:
2525
text = f"{ex_cls.__name__}: {ex}:\n"
2626
text += "".join(traceback.format_tb(tb))
2727

@@ -37,7 +37,7 @@ def log_uncaught_exceptions(ex_cls, ex, tb):
3737

3838

3939
class Movie:
40-
def __init__(self, border):
40+
def __init__(self, border) -> None:
4141
a = border.select_one(".movie .title > a")
4242
self.movie_url = urljoin(URL, a["href"])
4343

@@ -90,7 +90,7 @@ def __init__(self, border):
9090

9191

9292
class MovieInfoWidget(QWidget):
93-
def __init__(self):
93+
def __init__(self) -> None:
9494
super().__init__()
9595

9696
# TODO: можно и видео добавить
@@ -103,7 +103,7 @@ def __init__(self):
103103

104104
self.setLayout(layout)
105105

106-
def set_movie(self, movie):
106+
def set_movie(self, movie) -> None:
107107
data = dict()
108108

109109
# Скачивание обложки и получени base64
@@ -167,7 +167,7 @@ def set_movie(self, movie):
167167

168168

169169
class SchedulerMoviePage(QWidget):
170-
def __init__(self, schedule):
170+
def __init__(self, schedule) -> None:
171171
super().__init__()
172172

173173
self.schedule_date_str = datetime.strptime(
@@ -203,7 +203,7 @@ def __init__(self, schedule):
203203

204204

205205
class MainWindow(QMainWindow):
206-
def __init__(self):
206+
def __init__(self) -> None:
207207
super().__init__()
208208

209209
self.setWindowTitle("show_schedule_gui.py")
@@ -219,7 +219,7 @@ def __init__(self):
219219

220220
self.setCentralWidget(widget)
221221

222-
def load(self):
222+
def load(self) -> None:
223223
with urlopen(URL) as f:
224224
root = BeautifulSoup(f.read(), "lxml")
225225

0 commit comments

Comments
 (0)