Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
env
setup.cfg
2 changes: 1 addition & 1 deletion level_1/1.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from constants import ___


def is_user_banned(user_id: ___) -> ___:
def is_user_banned(user_id: int) -> bool:
pass


Expand Down
4 changes: 1 addition & 3 deletions level_1/10.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import uuid

from constants import ___


def stringify(value: ___) -> ___:
def stringify(value: str | int | float | None) -> str:
pass


Expand Down
2 changes: 1 addition & 1 deletion level_1/2.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from constants import ___


def is_adult(age: ___, country_name: ___) -> ___:
def is_adult(age: int, country_name: str) -> bool:
pass


Expand Down
2 changes: 1 addition & 1 deletion level_1/3.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from constants import ___


def compose_full_name(first_name: ___, last_name: ___, middle_name: ___) -> ___:
def compose_full_name(first_name: str, last_name: str, middle_name: str | None) -> str:
pass


Expand Down
2 changes: 1 addition & 1 deletion level_1/4.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from constants import ___


def calculate_age(date_of_birth: ___) -> ___:
def calculate_age(date_of_birth: datetime.date) -> int:
pass


Expand Down
2 changes: 1 addition & 1 deletion level_1/5.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from constants import ___


def is_correct_email(raw_email: ___) -> ___:
def is_correct_email(raw_email: str) -> bool:
pass


Expand Down
2 changes: 1 addition & 1 deletion level_1/6.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from constants import ___


def is_loan_amount_too_big(loan_amount_usd: ___, max_loan_amount_for_user_usd: ___) -> ___:
def is_loan_amount_too_big(loan_amount_usd: int, max_loan_amount_for_user_usd: int | None) -> bool:
pass


Expand Down
2 changes: 1 addition & 1 deletion level_1/7.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from constants import ___


def send_email(header: ___, text_content: ___, send_to: ___) -> ___:
def send_email(header: str, text_content: str, send_to: str) -> None:
pass


Expand Down
2 changes: 1 addition & 1 deletion level_1/8.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from constants import ___


def get_user_balance(user_id: ___) -> ___:
def get_user_balance(user_id: uuid.UUID) -> decimal.Decimal:
pass


Expand Down
4 changes: 1 addition & 3 deletions level_1/9.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import uuid

from constants import ___


def is_correct_int(raw_int: ___) -> ___:
def is_correct_int(raw_int: str | None) -> bool:
pass


Expand Down
2 changes: 1 addition & 1 deletion level_2/1.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from constants import ___


def get_avg_currency_rate(rates_history: ___) -> ___:
def get_avg_currency_rate(rates_history: list[float]) -> float:
pass


Expand Down
5 changes: 4 additions & 1 deletion level_2/10.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from constants import ___


def is_point_in_square(point: ___, left_upper_corner: ___, right_bottom_corner: ___) -> ___:
def is_point_in_square(point: tuple[int, int],
left_upper_corner: tuple[int, int],
right_bottom_corner: tuple[int, int],
) -> bool:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

С тайпхинтами дефы часто не умещаются в одну строку. Я обычно так форматирую:

def is_point_in_square(
    point: tuple[int, int],
    left_upper_corner: tuple[int, int],
    right_bottom_corner: tuple[int, int],
) -> bool:
    ...

pass


Expand Down
2 changes: 1 addition & 1 deletion level_2/2.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from constants import ___


def is_recovery_code_correct(code: ___, user_codes: ___) -> ___:
def is_recovery_code_correct(code: str, user_codes: list[str]) -> bool:
pass


Expand Down
4 changes: 3 additions & 1 deletion level_2/3.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
from constants import ___


def get_transaction_amount(transaction_id: ___, transactions_amounts_map: ___) -> ___:
def get_transaction_amount(transaction_id: int,
transactions_amounts_map: dict[int, decimal.Decimal],
) -> decimal.Decimal | None:
pass


Expand Down
2 changes: 1 addition & 1 deletion level_2/4.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from constants import ___


def ban_users(users_ids: ___) -> ___:
def ban_users(users_ids: set[int]) -> int:
pass


Expand Down
2 changes: 1 addition & 1 deletion level_2/5.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from constants import ___


def get_current_user() -> ___:
def get_current_user() -> tuple[str, int, str]:
pass


Expand Down
2 changes: 1 addition & 1 deletion level_2/6.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from constants import ___


def is_name_male(name: ___, name_gender_map: ___) -> ___:
def is_name_male(name: str, name_gender_map: dict[str, bool]) -> bool | None:
pass


Expand Down
2 changes: 1 addition & 1 deletion level_2/7.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from constants import ___


def calculate_total_spent_for_user(user: ___) -> ___:
def calculate_total_spent_for_user(user: tuple[str, int, list[int]]) -> int:
pass


Expand Down
4 changes: 3 additions & 1 deletion level_2/8.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from constants import ___


def calculate_total_spent_for_users(users_ids: ___, users_ids_to_users_map: ___) -> ___:
def calculate_total_spent_for_users(users_ids: set[int],
users_ids_to_users_map: dict[int: tuple[str, int, list[int]]],
) -> int:
pass


Expand Down
2 changes: 1 addition & 1 deletion level_2/9.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from constants import ___


def parse_receipt(raw_receipt: ___) -> ___:
def parse_receipt(raw_receipt: str) -> tuple[int, datetime.date, list[tuple[str, int, float]]]:
pass


Expand Down