Skip to content

Preserve custom acontainer factory return types - #72

Open
ShahadatTest wants to merge 1 commit into
wolph:developfrom
ShahadatTest:fix/type-custom-async-containers
Open

ShahadatTest wants to merge 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.

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.

1 participant