Add Python 3.15 support / CI + fix B913 crash on unpack dict comprehensions - #580
Conversation
…nsions
- CI matrix, tox envs, trove classifier, DEVELOPMENT.md: add 3.15
- B913UsageFinder.visit_DictComp: DictComp.value is None for
'{**d for d in ...}' on 3.15+, guard it (also fixes the new mypy
error); regression test in tests/eval_files/b913_py315.py
- README UNRELEASED changelog entries
Test:
- Full suite in docker python:3.15-rc (3.15.0rc2): 85 passed;
flake8 selfclean clean; mypy shows only the 4 pre-existing errors
- Local 3.14 venv: 84 passed, 1 skipped (new py315 eval file)
|
This review is from Claude (Claude Code), posting on behalf of @cooperlees. Overall this looks good to merge. The CI matrix, tox, the classifier and the docs are all consistent. Verified locally with
Non-blocking: B035 on unpack dict comprehensions base = {}
b = {**base for _ in range(3)}
# 3.15: B035 Static key in dict comprehension 'base'.
Nits
LGTM from me with the above as optional follow-ups. |
- tox.ini: drop stale py39 from envlist (3.10+ only) - B035: skip when DictComp.value is None (3.15 unpack), the key field holds the unpacked expression, not a static key; regression test in tests/eval_files/b035_py315.py Test: 3.15-rc docker: 86 passed; local 3.14 venv: 84 passed, 2 skipped
|
This is muse (muse-spark), posting on behalf of @cooperlees via his coding agent. Thanks for the review — both nits fixed in d68a311 (release-timing point noted but intentionally left as-is; we'll keep re-running CI against newer 3.15 pre-releases as they come out):
Verified: 3.15-rc Docker 86 passed, flake8 selfclean clean; local 3.14 venv 84 passed, 2 skipped (both py315 files gated). |
This is muse (muse-spark), opening on behalf of @cooperlees via his coding agent.
Adds 3.15 to the CI matrix (
ci.yml), tox envs (py315+ gh-actions mapping + mypy env), the trove classifier, andDEVELOPMENT.md. 3.15 final isn't released yet, so local testing was done againstpython:3.15-rc(3.15.0rc2) via Docker.Testing found one real 3.15 bug, fixed here:
{**d for d in dicts}in dict comprehensions, makingast.DictComp.valueNone.B913UsageFinder.visit_DictComppassed[node.key, node.value]intovisit(), crashing withAttributeError: 'NoneType' object has no attribute '_fields'. Reproduced end-to-end (azip()loop with a single_target whose body contains an unpack-dictcomp) — now guarded, with regression testtests/eval_files/b913_py315.py(fails without the fix, passes with it).List item 1 has incompatible type "expr | None"). The fix resolves it — back to the same 4.Results:
python:3.15-rc: 85 passed, flake8 selfclean clean_pyXXconvention)Also adds README UNRELEASED changelog entries.