Repository navigation
Conversation
| changing a width keeps everything else consistent. | ||
| """ | ||
|
|
||
| from typing import Final |
There was a problem hiding this comment.
На момент дедлайна не проходил ruff check
| return None | ||
|
|
||
| snowflake_id = ( | ||
| (timestamp_ms << (NODE_ID_BITS + SEQUENCE_ID_BITS)) |
There was a problem hiding this comment.
Вычисление сдвига дублировано в функции decode_timestamp_ms. Это может быть опасно, так как если логика поменяется, то надо будет исправлять в 2х местах, а это можно забыть, поэтому лучше было вынести вычисление в отдельную константу.Если бы работа оценивалась, то ставился бы минус балл по пункте S1 из критериев
|
|
||
| if cart_quantity < quantity: | ||
| print( | ||
| f"cart holds only {cart_quantity} unit(s) of product " |
There was a problem hiding this comment.
На момент дедлайна не проходил ruff check
| return 0 | ||
|
|
||
| for index, product in enumerate(storage): | ||
| if product[PRODUCT_ID_INDEX] == product_id: |
There was a problem hiding this comment.
Цикл:
for index, product in enumerate(storage):
if product[PRODUCT_ID_INDEX] == product_id:встречается несколько раз, лучше было бы использовать везде read_product. Код был бы понятнее.
Пункт S1
| """Parse one console line and carry out the command it names. | ||
| parts = line.split() | ||
|
|
||
| if parts == ["exit"]: |
There was a problem hiding this comment.
match case был бы попроще, код был бы понятнее
Минус 0.5 балла
No description provided.