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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Give Pyright what it wants (
alias
attributes everywhere) #3114base: main
Are you sure you want to change the base?
Give Pyright what it wants (
alias
attributes everywhere) #3114Changes from 5 commits
deb08a3
1e65f68
59abcf8
cbb08fb
9c97bad
35609d4
4bc3e58
37b9c38
3cda304
9eca851
ba67f7e
88cf458
819797a
f21cbb0
30befc9
a23712c
74e67f1
593701b
ff487e2
a6ea148
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 586 in src/trio/_tests/test_exports.py
Codecov / codecov/patch
src/trio/_tests/test_exports.py#L586
Check warning on line 593 in src/trio/_tests/test_exports.py
Codecov / codecov/patch
src/trio/_tests/test_exports.py#L593
Check warning on line 598 in src/trio/_tests/test_exports.py
Codecov / codecov/patch
src/trio/_tests/test_exports.py#L598
Check warning on line 607 in src/trio/_tests/test_exports.py
Codecov / codecov/patch
src/trio/_tests/test_exports.py#L605-L607
Check warning on line 610 in src/trio/_tests/test_exports.py
Codecov / codecov/patch
src/trio/_tests/test_exports.py#L610
Check warning on line 612 in src/trio/_tests/test_exports.py
Codecov / codecov/patch
src/trio/_tests/test_exports.py#L612
Check warning on line 616 in src/trio/_tests/test_exports.py
Codecov / codecov/patch
src/trio/_tests/test_exports.py#L616
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you declare
end_offset
outside the loop I think the warning goes away (and makes the code easier to read).codecov wants a
pragma: no branch
on the loop to hit 100%There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately the warning doesn't go away; it does make the code more correct (previously it didn't handle
start==len(file)-1
, I think)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think with the zero-initialization now that should be good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fairly gnarly to fix in an AST visitor, I don't see any way of doing it that's not overkill, but I think you could open an issue for ruff and see if they have a decent way of getting at it.
Check warning on line 620 in src/trio/_tests/test_exports.py
Codecov / codecov/patch
src/trio/_tests/test_exports.py#L620
Check warning on line 622 in src/trio/_tests/test_exports.py
Codecov / codecov/patch
src/trio/_tests/test_exports.py#L622
Check warning on line 624 in src/trio/_tests/test_exports.py
Codecov / codecov/patch
src/trio/_tests/test_exports.py#L624
Check warning on line 627 in src/trio/_tests/test_exports.py
Codecov / codecov/patch
src/trio/_tests/test_exports.py#L626-L627
Check failure on line 628 in src/trio/_tests/test_exports.py
GitHub Actions / Ubuntu (3.12, check formatting)
Mypy-Linux+Mac+Windows
Check notice on line 628 in src/trio/_tests/test_exports.py
GitHub Actions / Ubuntu (3.12, check formatting)
Mypy-Linux+Mac+Windows
Check warning on line 633 in src/trio/_tests/test_exports.py
Codecov / codecov/patch
src/trio/_tests/test_exports.py#L633
Check warning on line 644 in src/trio/_tests/test_exports.py
Codecov / codecov/patch
src/trio/_tests/test_exports.py#L644