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.unsupported-operator = "ignore"from[tool.ty]. On a synced Python 3.15 (regular GIL) environment the rule now reports zero diagnostics, so it can be enforced without any new findings.Files fixed:
sorts/iterative_merge_sort.py,sorts/quick_sort_3_partition.py,sorts/recursive_quick_sort.py-- the localComparableprotocols only declared the dunder used in one spot, so the operators at the call sites were flagged as unsupported. Declared the missing dunders (__le__,__ge__,__gt__respectively), matching the pattern insorts/merge_sort.py/sorts/quick_sort.py.computer_vision/mean_threshold.py--Image.load()isPixelAccess | Noneand grayscale pixels are read asfloat | tuple[int, ...], so the average/compare-and-write loops trippedunsupported-operator(plus aninvalid-assignmenton theNonesubscript). Added aNoneguard and narrowed the pixel to a numeric value, scoped to the grayscale images the docstring already requires.web_programming/get_amazon_product_data.py-- build the product link with an f-string instead of"prefix" + item.h2.a["href"], since the attribute value is not staticallystr. Matches the f-string already used at line 28.Verification (
uv sync --python 3.15, thenuv run --python 3.15 --with ty ty check):unsupported-operatordiagnostics remain and the total diagnostic count does not increase.sorts/iterative_merge_sort.py16 passed,sorts/quick_sort_3_partition.py39 passed,sorts/recursive_quick_sort.py9 passed,computer_vision/mean_threshold.pypassed.ruff checkandruff format --checkclean on the touched files.Checklist