Skip to content

Commit 3e93c82

Browse files
committed
Refactoring. Adding the None annotation to the return value
1 parent deae1bb commit 3e93c82

53 files changed

Lines changed: 96 additions & 91 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎No choice line edit.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
class Widget(QWidget):
17-
def __init__(self):
17+
def __init__(self) -> None:
1818
super().__init__()
1919

2020
self.setWindowTitle("No choice")
@@ -33,7 +33,7 @@ def __init__(self):
3333

3434
self.line_edit_no_choice.setFocus()
3535

36-
def on_text_edited_no_choice(self, text):
36+
def on_text_edited_no_choice(self, text) -> None:
3737
text = self.line_edit_source.text()[: len(text)]
3838
self.line_edit_no_choice.setText(text)
3939

‎ObjectWithArrayAccess.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55

66

77
class ObjectWithArrayAccess:
8-
def __init__(self):
8+
def __init__(self) -> None:
99
self._fields = dict()
1010

1111
def __getitem__(self, item):
1212
return self._fields.get(item)
1313

14-
def __setitem__(self, key, value):
14+
def __setitem__(self, key, value) -> None:
1515
self._fields[key] = value
1616

17-
def __len__(self):
17+
def __len__(self) -> int:
1818
return len(self._fields)
1919

2020

‎WrapperMap__work_with_dict_through_atts.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
class WrapperMap:
8-
def __init__(self, d: dict):
8+
def __init__(self, d: dict) -> None:
99
self.d = d
1010

1111
def get_value(self):
@@ -18,7 +18,7 @@ def __getattr__(self, item: str):
1818

1919
return value
2020

21-
def __repr__(self):
21+
def __repr__(self) -> str:
2222
return repr(self.d)
2323

2424

‎api_clans.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Api:
1414
# TODO: this
1515
API_URL = "<HOST>/api_clans/1/index.php?request="
1616

17-
def __init__(self, login: str, password: str):
17+
def __init__(self, login: str, password: str) -> None:
1818
self.login = login
1919
self.password = password
2020

‎ascii_table__simple_pretty__format.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def pretty_table(data, cell_sep=" | ", header_separator=True, align=">") -> str:
3232
return "\n".join(lines)
3333

3434

35-
def print_pretty_table(data, cell_sep=" | ", header_separator=True, align=">"):
35+
def print_pretty_table(data, cell_sep=" | ", header_separator=True, align=">") -> None:
3636
print(pretty_table(data, cell_sep, header_separator, align))
3737

3838

‎ascii_table__simple_pretty__ljust.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def pretty_table(data, cell_sep=" | ", header_separator=True) -> str:
3131
return "\n".join(lines)
3232

3333

34-
def print_pretty_table(data, cell_sep=" | ", header_separator=True):
34+
def print_pretty_table(data, cell_sep=" | ", header_separator=True) -> None:
3535
print(pretty_table(data, cell_sep, header_separator))
3636

3737

‎ascii_table__simple_pretty__rjust.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def pretty_table(data, cell_sep=" | ", header_separator=True) -> str:
3131
return "\n".join(lines)
3232

3333

34-
def print_pretty_table(data, cell_sep=" | ", header_separator=True):
34+
def print_pretty_table(data, cell_sep=" | ", header_separator=True) -> None:
3535
print(pretty_table(data, cell_sep, header_separator))
3636

3737

‎console_change_data_in_line.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import time
99

1010

11-
def f1(n):
11+
def f1(n) -> None:
1212
last_num_chars = 0
1313

1414
write, flush = sys.stdout.write, sys.stdout.flush
@@ -23,7 +23,7 @@ def f1(n):
2323
print()
2424

2525

26-
def f2(n):
26+
def f2(n) -> None:
2727
last_num_chars = 0
2828

2929
write, flush = sys.stdout.write, sys.stdout.flush

‎copy2clipboard.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from PySide.QtGui import QApplication
1616

1717

18-
def to(text: str):
18+
def to(text: str) -> None:
1919
app = QApplication([])
2020
app.clipboard().setText(text)
2121
app = None

‎copy2clipboard__via_pyperclip.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import pyperclip
88

99

10-
def to(text: str):
10+
def to(text: str) -> None:
1111
pyperclip.copy(text)
1212
pyperclip.paste()
1313

0 commit comments

Comments
 (0)