Title: Wrong type annotation on `Index.commit` for `parent_commits` · Issue #1866 · gitpython-developers/GitPython · GitHub
Open Graph Title: Wrong type annotation on `Index.commit` for `parent_commits` · Issue #1866 · gitpython-developers/GitPython
X Title: Wrong type annotation on `Index.commit` for `parent_commits` · Issue #1866 · gitpython-developers/GitPython
Description: With GitPython==3.1.42 one can observe following annotation of parent_commits argument to IndexFile.commit ([1]): ... parent_commits: Union[Commit_ish, None] = None, ... which is obviously not correct, because that argument just passed u...
Open Graph Description: With GitPython==3.1.42 one can observe following annotation of parent_commits argument to IndexFile.commit ([1]): ... parent_commits: Union[Commit_ish, None] = None, ... which is obviously not corr...
X Description: With GitPython==3.1.42 one can observe following annotation of parent_commits argument to IndexFile.commit ([1]): ... parent_commits: Union[Commit_ish, None] = None, ... which is obviously not corr...
Opengraph URL: https://github.com/gitpython-developers/GitPython/issues/1866
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Wrong type annotation on `Index.commit` for `parent_commits`","articleBody":"With `GitPython==3.1.42` one can observe following annotation of `parent_commits` argument to `IndexFile.commit` ([1]):\r\n\r\n```\r\n...\r\nparent_commits: Union[Commit_ish, None] = None,\r\n...\r\n```\r\n\r\nwhich is obviously not correct, because that argument just passed unmodified downwards to `Commit.create_from_tree`, which has following annotation instead ([2]):\r\n\r\n```\r\nparent_commits: Union[None, List[\"Commit\"]] = None\r\n```\r\n\r\nThat leads to nasty Mypy warnings when one's trying to use `IndexFile.commit` with anything different than `None`.\r\n\r\n---\r\n[1] - https://github.com/gitpython-developers/GitPython/blob/3.1.42/git/index/base.py#L1080\r\n[2] - https://github.com/gitpython-developers/GitPython/blob/3.1.42/git/objects/commit.py#L506\r\n\r\n","author":{"url":"https://github.com/mshonichev","@type":"Person","name":"mshonichev"},"datePublished":"2024-03-12T12:22:12.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/1866/GitPython/issues/1866"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f7a08648-eab5-abc2-5fb8-9fe352861c20 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B1B8:17C6E:16B87B9:1FDFB80:6968F79B |
| html-safe-nonce | fda6deadecba325186e59588ced16a91c2955d7203b589bcc02853672aa8c317 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMUI4OjE3QzZFOjE2Qjg3Qjk6MUZERkI4MDo2OTY4Rjc5QiIsInZpc2l0b3JfaWQiOiI1OTYwNzY4OTY3NjU3NzE1NjExIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f50ff2212cf9f71f83e6f2a6f93d749b9afae26fc82a5b012aff08a9d279adde |
| hovercard-subject-tag | issue:2181486289 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/gitpython-developers/GitPython/1866/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6fc52ff322099ca13ec495e2c0347e89047fb209efa2ef93742c9ba77645a6e7/gitpython-developers/GitPython/issues/1866 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6fc52ff322099ca13ec495e2c0347e89047fb209efa2ef93742c9ba77645a6e7/gitpython-developers/GitPython/issues/1866 |
| og:image:alt | With GitPython==3.1.42 one can observe following annotation of parent_commits argument to IndexFile.commit ([1]): ... parent_commits: Union[Commit_ish, None] = None, ... which is obviously not corr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mshonichev |
| hostname | github.com |
| expected-hostname | github.com |
| None | b229519d8adb10c7bce106d807003c585a919bd07491d720d8aada92dc43746b |
| turbo-cache-control | no-preview |
| go-import | github.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126087 |
| octolytics-dimension-repository_nwo | gitpython-developers/GitPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126087 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/GitPython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 176ddd19d172d50da7e20b971f928ffe57138b35 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width