Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your change
Contributes to #15187.
Removes
rules.invalid-return-type = "ignore"from[tool.ty]. On a synced Python 3.15 (regular GIL) environment the rule now reports zero diagnostics.Files fixed:
data_structures/arrays/dynamic_array.py-- annotatedself.arrayaslist[int | None]and narrowed the value inget(the bounds check already guarantees a filled slot).graphs/bi_directional_dijkstra.py--bidirectional_dijcan return thenp.infsentinel / fractional path cost, so the return annotation isfloat, notint.graphs/hopcroft_karp.py--pair_leftstoresT | object(the_NILsentinel); the comprehension filters_NILout, so the result is cast todict[T, T].computer_vision/mosaic_augmentation.py-- the returned image is annp.ndarray, not alist; annotated the return astuple[np.ndarray, list, str]and typedpath_listaslist[str].machine_learning/mfcc.py--mel_to_freqis called with both a scalar and an array; added overloads so the array call returns annp.ndarray(matching itstuple[np.ndarray, np.ndarray]return annotation).networking_flow/ford_fulkerson.py-- the graph is untyped (list), so the accumulator can beint | float; widened the return annotation accordingly.other/dancing_links.py--_choose_columncan returnNonewhen no columns remain (already handled by the caller); annotatedColumnNode | None.web_programming/random_anime_character.py-- narrowed the parsed<meta>contenttostrbefore returning thetuple[str, str, str].Verification (
uv sync --python 3.15, thenuv run --python 3.15 --with ty ty check):invalid-return-typediagnostics remain and the total diagnostic count does not increase.dynamic_array.py,bi_directional_dijkstra.py,dancing_links.py,mfcc.py,hopcroft_karp.py,ford_fulkerson.py).ruff checkandruff format --checkclean on the touched files.Checklist