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

Fix type hint forSymbolicReference.reference property#2074

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 1 commit intogitpython-developers:mainfromemmanuel-ferdman:main
Sep 30, 2025

Conversation

emmanuel-ferdman
Copy link
Contributor

PR Summary

This PR fixes mypy errors introduced in v3.1.45 where code likerepo.head.ref.checkout() fails type checking even though it works at runtime. The issue is thatSymbolicReference.reference was typed to returnSymbolicReference, but it actually returnsReference subclasses that have methods likecheckout() andtracking_branch(). Changed the return type annotation fromSymbolicReference toReference and added an explicit cast in_get_reference() to match what actually happens at runtime. This is a type-only change with no behavioral impact.

Fixes#2066.

Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
@Byron
Copy link
Member

Thanks a lot, looks good to me!

Besides that, we do have mypi type checks, but it seems like they are advisory only and can't fail CI.

@ByronByron merged commit963b6f8 intogitpython-developers:mainSep 30, 2025
27 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Incorrect return type hint inSymbolicReference.reference leads to mypy errors
2 participants
@emmanuel-ferdman@Byron

[8]ページ先頭

©2009-2025 Movatter.jp