Skip to content

mypy: Fix all index #363

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

mypy: Fix all index #363

wants to merge 2 commits into from

Conversation

Avasam
Copy link
Contributor

@Avasam Avasam commented May 4, 2025

No description provided.

Comment on lines +154 to +156
# type-ignore: This makes absolutes os.Pathlike unsupported in this branch.
# Either this or we don't support bytes-based paths, or we complexify this branch.
return os.path.join(new_root, pathname[1:]) # type: ignore[index]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's a decision to be taken here.

  1. Don't support PathLike in this branch (current behaviour)
  2. Don't support bytes | PathLike[bytes] in this branch
Suggested change
# type-ignore: This makes absolutes os.Pathlike unsupported in this branch.
# Either this or we don't support bytes-based paths, or we complexify this branch.
return os.path.join(new_root, pathname[1:]) # type: ignore[index]
# type-ignore: This makes absolutes os.Pathlike unsupported in this branch.
# Either this or we don't support bytes-based paths, or we complexify this branch.
return os.path.join(new_root, str(pathname)[1:])
  1. Support both, requires extra checking.

@Avasam Avasam force-pushed the mypy--fix-all-index branch from ee70763 to b045214 Compare May 4, 2025 16:02
Sign up for free to 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.

1 participant