Skip to content

Accept frozendict namespaces in type constructors on Python 3.15 - #16794

Merged
srittau merged 2 commits into
python:mainfrom
carljm:cjm/frozendict-type-namespace
Nov 15, 2026
Merged

srittau merged 2 commits into
python:mainfrom
carljm:cjm/frozendict-type-namespace

Conversation

@carljm

@carljm carljm commented Nov 13, 2026

Copy link
Copy Markdown
Member

Python 3.15 allows either dict or frozendict as the namespace for type construction.

namespace = frozendict(answer=42)
Answer = type("Answer", (), namespace)
assert vars(Answer)["answer"] == 42

@github-actions

This comment has been minimized.

Comment thread stdlib/builtins.pyi Resolved
@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@srittau
srittau merged commit afd3b6d into python:main Nov 15, 2026
88 checks passed
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.

3 participants