Skip to content

Rename unreachable_lines to skipped_lines - #15483

Merged
ilevkivskyi merged 2 commits into
python:masterfrom
ikonst:06-20-rename-reachability
Jun 22, 2023
Merged

Rename unreachable_lines to skipped_lines#15483
ilevkivskyi merged 2 commits into
python:masterfrom
ikonst:06-20-rename-reachability

Conversation

@ikonst

@ikonstikonst commented Jun 21, 2023

Copy link
Copy Markdown
Contributor

In #15164 we've made it so that # type: ignores in lines skipped in semantic analysis would not be flagged as unused.

In #15164 they were called "unreachable" lines but unreachability during type-checking can result in the "Statement is unreachable" error, while these statements are pruned before type-checking, so for clarity we'll use the term "skipped".

@ikonst
ikonstforce-pushed the 06-20-rename-reachability branch from 7b3c35a to 62df7bbCompareJune 21, 2023 00:18
@github-actions

This comment has been minimized.

@ilevkivskyiilevkivskyi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG, but there are small comments.

Comment threadmypy/errors.py Outdated

# Lines that are statically unreachable (e.g. due to platform/version check).
unreachable_lines: dict[str, set[int]]
# Lines that were skipped during semantic analysis (would not be type-checked).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep the examples of a reason to skip: e.g. due to platform/version check

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, always-true: 5b6dc5f

Comment threadmypy/nodes.py Outdated
ignored_lines: dict[int, list[str]]
# Lines that are statically unreachable (e.g. due to platform/version check).
unreachable_lines: set[int]
# Lines that were skipped during semantic analysis (would not be type-checked).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep the examples of a reason to skip: e.g. due to platform/version check

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, always-true: 5b6dc5f

@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@ilevkivskyi
ilevkivskyi merged commit aba35af into python:masterJun 22, 2023
@ikonst
ikonst deleted the 06-20-rename-reachability branch June 22, 2023 17:33
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@ikonst@ilevkivskyi