Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

typing fixes - DiffIndex generic type and IndexFile items#1925

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Byron merged 2 commits intogitpython-developers:mainfromAndrej730:main
Jun 3, 2024
Merged

Conversation

Andrej730
Copy link
Contributor

Example issue with DiffIndex:

repo=git.Repo(path_dir)diff=repo.index.diff(None)modified_files= [dfordinrepo.index.diff(None)]reveal_type(modified_files)# list[Unknown] instead of list[Diff]

Example issue with IndexFile:

path:os.PathLike= ...repo=git.Repo(path_dir)# Argument of type "PathLike[Unknown]"# cannot be assigned to parameter "items" of type "Sequence[git.types.PathLike | Blob | BaseIndexEntry | Submodule]" in function "add"# "PathLike[Unknown]" is incompatible with "Sequence[git.types.PathLike | Blob | BaseIndexEntry | Submodule]"repo.index.add(path)

Error before commit:path: os.PathLike = ...repo = git.Repo(path_dir)repo.index.add(path)
Example before this commit:repo = git.Repo(path_dir)diff = repo.index.diff(None)modified_files = [d for d in repo.index.diff(None)]reveal_type(modified_files) # list[Unknown] instead of list[Diff]
Copy link
Member

@ByronByron left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the typing fix, it's much appreciated.

Andrej730 reacted with thumbs up emoji
@ByronByron merged commite51bfdf intogitpython-developers:mainJun 3, 2024
26 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ByronByronByron approved these changes

Assignees
No one assigned
Labels
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@Andrej730@Byron

[8]ページ先頭

©2009-2025 Movatter.jp