[ty] Add Final mdtests for loops and redeclaration#23331
[ty] Add Final mdtests for loops and redeclaration#23331carljm merged 2 commits intoastral-sh:mainfrom
Final mdtests for loops and redeclaration#23331Conversation
|
In the same style as #23330, |
a2753e3 to
7143c25
Compare
|
Thank you. I'd like to clarify the question in astral-sh/ty#2689 (comment) first |
7143c25 to
295d9d2
Compare
Final reassignment in loopsFinal declarations in loops
Typing conformance resultsNo changes detected ✅ |
|
Memory usage reportMemory usage unchanged ✅ |
Following the discussion in the issue thread, I've updated this PR to prevent |
|
As commented in astral-sh/ty#2689 (comment), I would prefer that we not introduce this special case to prohibit |
Final declarations in loopsFinal mdtests for loops and redeclaration
295d9d2 to
48ee5b1
Compare
|
@carljm I think I managed to get everything down properly 😅 |
crates/ty_python_semantic/resources/mdtest/type_qualifiers/final.md
Outdated
Show resolved
Hide resolved
* main: (43 commits) [`ruff`] Suppress diagnostic for strings with backslashes in interpolations before Python 3.12 (`RUF027`) (#21069) [flake8-bugbear] Fix B023 false positive for immediately-invoked lambdas (#23294) [ty] Add `Final` mdtests for loops and redeclaration (#23331) [`flake8-pyi`] Also check string annotations (`PYI041`) (#19023) Remove AlexWaygood as a flake8-pyi codeowner (#23347) [ty] Add comments to clarify the purpose of `NominalInstanceType::class_name` and `NominalInstanceType::class_module_name` (#23339) Add attestations for release artifacts and Docker images (#23111) [ty] Fix `assert_type` diagnostic messages (#23342) [ty] Force-update all insta snapshots (#23343) Add Q004 to the list of conflicting rules (#23340) [ty] Fix `invalid-match-pattern` false positives (#23338) [ty] new diagnostic called-match-pattern-must-be-a-type (#22939) [ty] Update flaky projects (#23337) [ty] Increase timeout for ecosystem report to 40 min (#23336) Bump ecosystem-analyzer pin (#23335) [ty] Replace `strsim` with CPython-based Levenshtein implementation (#23291) [ty] Add mdtest for staticmethod assigned in class body (#23330) [ty] fix inferring type variable from string literal argument (#23326) [ty] bytes literal is a sequence of integers (#23329) Update rand and getrandom (#23333) ...
Summary
Fixes astral-sh/ty#2689
Update
Finalmdtests to reflect current policy for loop usage and same-scope redeclaration, and document a known TODO loop limitation.Test Plan
Finalreassignment in a loop errorsFinaldeclarations in loop bodies are acceptedFinalredeclaration is acceptedFinal-in-loop limitation is documented via TODO mdtest