Skip to content

zavod #53: Рукописные уроки 105–112 - #40

Merged
gon7187 merged 3 commits into
mainfrom
zavod/53-rukopisnye-uroki-105-112
Oct 22, 2026
Merged

gon7187 merged 3 commits into
mainfrom
zavod/53-rukopisnye-uroki-105-112

Conversation

@gon7187

@gon7187 gon7187 commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Рукописные уроки 105–112

Круг: 1

Критерии

  • ✓ c1 — app/handwritten/lessons_db_concurrency.py:88; tests/test_handwritten_db_concurrency.py:178–203 проверяют восемь id, реестр, номера, названия и 120 уроков. Отчёт круга: 59 passed, пропусков нет.
  • ✓ c2 — tests/test_handwritten_db_concurrency.py:206–246 проверяют три карточки, исполнение примеров, id и виды вопросов, reference, starter, подсказки и отсутствие шаблонных фраз. Отчёт круга: 59 passed.
  • ✓ k105 — app/handwritten/lessons_db_concurrency.py:162–189; tests/test_handwritten_db_concurrency.py:314–327 проверяют user_totals через run_code, включая пользователя без заказов и пустые таблицы. Отчёт круга: 59 passed.
  • ✓ k106 — app/handwritten/lessons_db_concurrency.py:259–283; tests/test_handwritten_db_concurrency.py:330–338 проверяют create/update/delete и неизменность исходного словаря через run_code. Отчёт круга: 59 passed.
  • ✓ k107 — tests/test_handwritten_db_concurrency.py:341–350 проверяют build_query через run_code: алфавитный порядок, плейсхолдеры, отдельные значения и отсутствие WHERE без фильтров. Отчёт круга: 59 passed.
  • ✓ k108 — tests/test_handwritten_db_concurrency.py:353–374 проверяют transfer через run_code: успешный перевод, нехватку денег и сохранность исходных балансов. Отчёт круга: 59 passed.
  • ✓ k109 — tests/test_handwritten_db_concurrency.py:377–386 проверяют split_chunks через run_code: [[1, 2, 3], [4, 5]] и три пустые порции. Отчёт круга: 59 passed.
  • ✓ k110 — tests/test_handwritten_db_concurrency.py:389–396 проверяют pool_map через run_code при workers=1, 2, 3 и пустом входе. Отчёт круга: 59 passed.
  • ✓ k111 — tests/test_handwritten_db_concurrency.py:399–435 проверяют сигнатуры Account и withdraw, последовательные списания через lambda, отказ без изменений и списание всего баланса. Отчёт круга: 59 passed.
  • ✓ k112 — tests/test_handwritten_db_concurrency.py:438–451 проверяют process_queue через run_code, повторную постановку, пустую очередь и использование deque. Отчёт круга: 59 passed.
  • ✓ c3 — app/handwritten/lessons_db_concurrency.py:93–160 и остальные блоки LESSONS: карточки последовательно объясняют понятие, применение и ошибку; choice проверяют код, варианты сопоставимы. tests/test_handwritten_db_concurrency.py:249–300 проверяют настоящий вывод комментариев и вопросов, форму и длину вариантов. Отчёт круга: 59 passed.
  • ✓ c4 — tests/test_handwritten_db_concurrency.py:303–311 проверяют каждую карточку раннером: run=False только при невозможности исполнения; остальные примеры исполняются. Отчёт круга: 59 passed.

Изменённые файлы

  • app/handwritten/lessons_db_concurrency.py
  • tests/test_handwritten_db_concurrency.py

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T23:01:54.277944Z 89d54d2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@gon7187
gon7187 merged commit 44074ab into main Oct 22, 2026
2 checks passed
@gon7187
gon7187 deleted the zavod/53-rukopisnye-uroki-105-112 branch October 22, 2026 23:01

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 89d54d248a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

_holds("pool_map(lambda x: x * 2, [1, 2, 3], 1) == [2, 4, 6]"),
_holds("pool_map(lambda x: x * 2, [], 2) == []"),
],
"def pool_map(func, items, workers):\n return [func(item) for item in items]\n",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Make pool_map use its worker limit

When func performs slow or blocking work and workers > 1, this reference still invokes every item sequentially and never reads workers, so the exercise accepts an implementation with no thread pool or parallelism at all. The tests only compare returned values, allowing learners to pass the thread-pool lesson without satisfying the prompt's concurrency requirement; use a real pool (and enable the required module in the evaluator) or change the exercise contract.

Useful? React with 👍 / 👎.

Comment on lines +802 to +804
" if self.balance < amount:\n"
" return False\n"
" self.balance -= amount\n"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Guard withdraw with a real lock

When two threads call withdraw concurrently, both can pass the balance check before either debit completes, causing both calls to return True and potentially producing an overdrawn or lost-update balance. Merely placing the check and mutation in one method does not make them atomic, yet this is the reference answer for the locks lesson and the added tests exercise it only sequentially; initialize a lock and hold it across both operations.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant