Skip to content

Add conformance tests to allow soft keywords in as namedtuple fields and disallow hard keywords - #2399

Open
quag wants to merge 1 commit into
python:mainfrom
quag:main
Open

quag wants to merge 1 commit into
python:mainfrom
quag:main

Conversation

@quag

@quag quag commented Dec 4, 2026

Copy link
Copy Markdown

The zuban v0.11.1 type checker had a bug where it disallowed soft keywords ("match", "case", and "type") to be field names of namedtuples. namedtuple fields must be valid python identifiers that do not start with a "_". Soft keywords are valid python identifiers. This bug will be fixed in the next version of Zuban. This commit adds conformance tests for both allowing soft keywords as namedtuple fields and disallowing hard keywords.

The other type checkers all correctly allowed soft keywords and disallowed hard keywords.

https://docs.python.org/3/reference/lexical_analysis.html#keywords
https://docs.python.org/3/reference/lexical_analysis.html#soft-keywords
https://docs.python.org/3/library/keyword.html

@python-cla-bot

python-cla-bot Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

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