Skip to content

3. Чувашов Лев Юрьевич. 613 - #42

Closed
LeoChooAvia wants to merge 21 commits into
python-department:mainfrom
LeoChooAvia:main
Closed

LeoChooAvia wants to merge 21 commits into
python-department:mainfrom
LeoChooAvia:main

Conversation

@LeoChooAvia

@LeoChooAvia LeoChooAvia commented Sep 25, 2026 •

Copy link
Copy Markdown
  1. Домашнее задание на 26.09.2026
  2. Домашнее задание на 2.10.2026
  3. Домашнее задание на 12.10.2026

@github-actions github-actions Bot added the 613 label Sep 25, 2026
@LeoChooAvia LeoChooAvia changed the title 1. Чувашов Лев Юрьевич. 613 2. Чувашов Лев Юрьевич. 613 Oct 2, 2026
@LeoChooAvia LeoChooAvia changed the title 2. Чувашов Лев Юрьевич. 613 3. Чувашов Лев Юрьевич. 613 Oct 9, 2026
Comment thread src/part1/snowflake.py
# TODO: реализуйте функцию
return 0

timestamp_ms = (snowflake_id >> 22) & (2**TIMESTAMP_BITS - 1)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Магические константы усложняют понимание кода.
Пункт S3, минус балл.

Comment thread src/part2/cart.py
return (product_id, 0)


def find_cart_line(cart: list[CartLine], product_id: int) -> bool:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Тут можно было просто

return read_cart_line(...) is not None

Пункт S1

Comment thread src/part2/crud.py
if not storage:
return PRODUCT_ID_MIN

indexes = [i[PRODUCT_ID_INDEX] for i in storage]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Название для переменной i обычно используется для индекса, так что тут оно сбивает с толку при первом прочтении.
Пункт M2

Comment thread src/part3/utils.py
for product in storage:
row = "|"
for i in range(len(TABLE_HEADERS)):
row += (

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Можно было использовать f строки и было проще.
Пункт T8

@LeoChooAvia LeoChooAvia closed this Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants