diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eba74f4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +venv/ \ No newline at end of file diff --git a/level_1/1.py b/level_1/1.py index 1813c9f..97ba86b 100644 --- a/level_1/1.py +++ b/level_1/1.py @@ -1,7 +1,7 @@ from constants import ___ -def is_user_banned(user_id: ___) -> ___: +def is_user_banned(user_id: int) -> bool: pass diff --git a/level_1/10.py b/level_1/10.py index d31d5d1..7c88c12 100644 --- a/level_1/10.py +++ b/level_1/10.py @@ -3,7 +3,7 @@ from constants import ___ -def stringify(value: ___) -> ___: +def stringify(value: str|int|float|None) -> str: pass diff --git a/level_1/2.py b/level_1/2.py index 8a2c1bf..3a52209 100644 --- a/level_1/2.py +++ b/level_1/2.py @@ -1,7 +1,7 @@ from constants import ___ -def is_adult(age: ___, country_name: ___) -> ___: +def is_adult(age: str, country_name: str) -> bool: pass diff --git a/level_1/3.py b/level_1/3.py index ae55bfd..ed870fd 100644 --- a/level_1/3.py +++ b/level_1/3.py @@ -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 diff --git a/level_1/4.py b/level_1/4.py index 4b4cbe5..882beab 100644 --- a/level_1/4.py +++ b/level_1/4.py @@ -3,7 +3,7 @@ from constants import ___ -def calculate_age(date_of_birth: ___) -> ___: +def calculate_age(date_of_birth: int) -> int: pass diff --git a/level_1/5.py b/level_1/5.py index 0728530..9b06931 100644 --- a/level_1/5.py +++ b/level_1/5.py @@ -1,7 +1,7 @@ from constants import ___ -def is_correct_email(raw_email: ___) -> ___: +def is_correct_email(raw_email: str) -> bool: pass diff --git a/level_1/6.py b/level_1/6.py index 7cb57fc..4fa1251 100644 --- a/level_1/6.py +++ b/level_1/6.py @@ -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: str, max_loan_amount_for_user_usd: str) -> bool: pass diff --git a/level_1/7.py b/level_1/7.py index 68c6890..912fdc0 100644 --- a/level_1/7.py +++ b/level_1/7.py @@ -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 diff --git a/level_1/8.py b/level_1/8.py index 8ba8083..f009c27 100644 --- a/level_1/8.py +++ b/level_1/8.py @@ -4,7 +4,7 @@ from constants import ___ -def get_user_balance(user_id: ___) -> ___: +def get_user_balance(user_id: uuid.UUID) -> decimal.Decimal: pass diff --git a/level_1/9.py b/level_1/9.py index fb7fc80..f73ca74 100644 --- a/level_1/9.py +++ b/level_1/9.py @@ -3,7 +3,7 @@ from constants import ___ -def is_correct_int(raw_int: ___) -> ___: +def is_correct_int(raw_int: str|None) -> bool: pass diff --git a/level_2/1.py b/level_2/1.py index c6ead64..f6ebd55 100644 --- a/level_2/1.py +++ b/level_2/1.py @@ -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 diff --git a/level_2/10.py b/level_2/10.py index 69f7bd0..dbde57d 100644 --- a/level_2/10.py +++ b/level_2/10.py @@ -1,7 +1,7 @@ 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: pass diff --git a/level_2/2.py b/level_2/2.py index e2ab2aa..e9d4a9b 100644 --- a/level_2/2.py +++ b/level_2/2.py @@ -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 diff --git a/level_2/3.py b/level_2/3.py index 8487e4b..ddcec5f 100644 --- a/level_2/3.py +++ b/level_2/3.py @@ -3,7 +3,7 @@ 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 @@ -13,5 +13,7 @@ def get_transaction_amount(transaction_id: ___, transactions_amounts_map: ___) - 514: decimal.Decimal("164.1"), 372: decimal.Decimal("92"), } + + assert get_transaction_amount(transaction_id=156, transactions_amounts_map=transactions_amounts_map) == decimal.Decimal("30.6") assert get_transaction_amount(transaction_id=1000, transactions_amounts_map=transactions_amounts_map) is None diff --git a/level_2/4.py b/level_2/4.py index 791b2e0..8136322 100644 --- a/level_2/4.py +++ b/level_2/4.py @@ -1,7 +1,7 @@ from constants import ___ -def ban_users(users_ids: ___) -> ___: +def ban_users(users_ids: set[int]) -> int: pass diff --git a/level_2/5.py b/level_2/5.py index 2b0ce2d..b6b86f4 100644 --- a/level_2/5.py +++ b/level_2/5.py @@ -1,7 +1,7 @@ from constants import ___ -def get_current_user() -> ___: +def get_current_user() -> tuple[str, int, str]: pass diff --git a/level_2/6.py b/level_2/6.py index af117e9..0d53207 100644 --- a/level_2/6.py +++ b/level_2/6.py @@ -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 diff --git a/level_2/7.py b/level_2/7.py index f8f7f6f..1408a00 100644 --- a/level_2/7.py +++ b/level_2/7.py @@ -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 diff --git a/level_2/8.py b/level_2/8.py index 1801197..5eaa8ab 100644 --- a/level_2/8.py +++ b/level_2/8.py @@ -1,7 +1,7 @@ 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 diff --git a/level_2/9.py b/level_2/9.py index 693804a..8ed5f0c 100644 --- a/level_2/9.py +++ b/level_2/9.py @@ -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 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..d60becc --- /dev/null +++ b/setup.cfg @@ -0,0 +1,6 @@ +[mypy] +ignore_missing_imports = True +dissalow_incomplete_defs = True +dissalow_untyped_calls = True +dissalow_untyped_defs = True +tests = True \ No newline at end of file