Skip to content

Preserve custom acontainer factory return types - #72

Merged
wolph merged 1 commit into
wolph:developfrom
ShahadatTest:fix/type-custom-async-containers
Nov 5, 2026
Merged

wolph merged 1 commit into
wolph:developfrom
ShahadatTest:fix/type-custom-async-containers

Conversation

@ShahadatTest

Copy link
Copy Markdown
Contributor

acontainer() accepts arbitrary collection factories at runtime, but its three overloads reject frozenset and custom functions. Add a generic factory overload that retains the concrete return type. The regression test checks both runtime results and inferred types for frozenset[int] and a summary dict. Built-in tuple/list/set overloads remain first and keep their existing precision.

Before: basedpyright rejects both supported custom-container calls (8 diagnostics). After: whole-project mypy and basedpyright pass; pyrefly reports 0 errors. Python 3.10/3.12: 429 passed, 5 IANA-timezone skips and 100% statement/branch coverage each. Ruff lint/format and diff checks pass. Test environments set asyncio_default_fixture_loop_scope=function explicitly.

AI assistance: OpenAI Codex found this by code inspection, implemented and tested it at the account owner’s request ("15 TA koro aro"). No personal production incident or independent human review is claimed.

@wolph
wolph merged commit 04d802f into wolph:develop Nov 5, 2026
17 checks passed
wolph added a commit that referenced this pull request Nov 5, 2026
@wolph

wolph commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Thank you for the fix :) The implementation already took any factory, so the overloads were the only thing in the way. I've added a changelog entry on top in 237a670, beyond that it's merged as it was. I'm working on a new release (4.2.0), should be out soon :)

@wolph

wolph commented Nov 5, 2026

Copy link
Copy Markdown
Owner

I've created a new release (v4.2.0) which includes your fix, thanks again for the help :)

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.

2 participants