Skip to content

Initialize BarrelList without truth-testing iterable inputs - #662

Open
Gambit-Checkmate wants to merge 1 commit into
mahmoud:masterfrom
Gambit-Checkmate:fix/barrellist-iterable-init
Open

Gambit-Checkmate wants to merge 1 commit into
mahmoud:masterfrom
Gambit-Checkmate:fix/barrellist-iterable-init

Conversation

@Gambit-Checkmate

@Gambit-Checkmate Gambit-Checkmate commented Oct 27, 2026 •

Copy link
Copy Markdown

The change

Closes #660.

Treat None as the omitted iterable rather than truth-testing every input. BarrelList currently silently drops a false-valued iterable's contents and rejects a valid iterable whose truth value is ambiguous. Iteration itself now determines contents, as for builtin list. Existing explicit-None behavior remains empty; invalid false non-iterables such as 0 now raise TypeError.

Three regressions fail before the change: nonempty false-valued iterable, ambiguous-truth iterable, false non-iterable. Four controls cover None and empty list/tuple/iterator. This does not alter pending #617's copy/pickle reduction or #613's insertion normalization.

Validation on Windows / CPython 3.13.13:

  • Full unit/doctest suite: 781 passed, 1 skipped, 22 subtests passed.
  • New-test Ruff E9/F and format, compileall and git diff checks passed.
  • Full listutils Ruff E9/F has three pre-existing F841 locals in setitem, as on pristine master; not altered here.
  • Wheel and sdist builds passed. No version bump.
  • Other platforms/interpreters await upstream CI; no coverage percentage claimed.

The backstory

Previous contribution #601 was acknowledged and incorporated in #609. This follow-up came from inspecting current master and comparing documented container behavior with builtin containers, not personal production usage. Existing related contributions were checked before filing the linked issue.

AI assistance

  • Harness/tooling: OpenAI Codex, Git, GitHub CLI/API, Python, pytest and Ruff. Codex performed investigation, implementation, testing and submission.
  • Model(s): GPT-6 family; the exact deployment identifier is not exposed in this session.
  • Original prompt(s), relevant verbatim excerpts from the daily automation (the mailbox workflow and local memory path are omitted):

每天早上 8 点在本会话实际提交两个高质量的开源贡献 PR,把创建并获得 GitHub PR 链接作为每日完成目标。首批候选不合适时必须继续扩大仓库与问题搜索范围,不因候选重复、单个问题困难或尚未发现合适 issue 就结束;没有合适公开 issue 时可以检查代码、复现真实缺陷,确认无重复后报告问题并提交独立修复。

只有改动真实、有依据、验证充分且账号有权限时才推送分支并创建 PR;绝不降低 star 门槛,不提交空改动、无关改动、未经验证或重复 PR,尊重上游 AI 贡献和认领规则。

Hosted CI: Actions run 40424154552 is action_required for external-contribution approval. No hosted tests have executed for this head.

This branch has not been deployed

No deployments
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.

BarrelList constructor drops false-valued iterable contents

1 participant