Title: Use property decorator to support typing by Andrej730 · Pull Request #2015 · gitpython-developers/GitPython · GitHub
Open Graph Title: Use property decorator to support typing by Andrej730 · Pull Request #2015 · gitpython-developers/GitPython
X Title: Use property decorator to support typing by Andrej730 · Pull Request #2015 · gitpython-developers/GitPython
Description: It seems this type of properties are not supported by type checkers (mypy, pyright) and using property decorator fixes the issue. commit = property( _get_commit, set_commit, # type: ignore[arg-type] doc="Query or set commits directly", ) See example below. import git path = "" repo = git.Repo(str(path), search_parent_directories=True) # Before this commit. reveal_type(repo.head.object) # Any reveal_type(repo.head.commit) # Any reveal_type(repo.description) # Any # After this commit. reveal_type(repo.head.object) # AnyGitObject reveal_type(repo.head.commit) # Commit reveal_type(repo.description) # str
Open Graph Description: It seems this type of properties are not supported by type checkers (mypy, pyright) and using property decorator fixes the issue. commit = property( _get_commit, set_commit, # ...
X Description: It seems this type of properties are not supported by type checkers (mypy, pyright) and using property decorator fixes the issue. commit = property( _get_commit, set_commit, # ...
Opengraph URL: https://github.com/gitpython-developers/GitPython/pull/2015
X: @github
Domain: redirect.github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:ed2a74b5-d018-8921-8604-e85b32e1855e |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C2F0:BB336:340DF10:4363D99:6990ED3E |
| html-safe-nonce | 1224235b227738bcdbec69a48a322380859a233c9c2f278b66b42dca0b0c804e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMkYwOkJCMzM2OjM0MERGMTA6NDM2M0Q5OTo2OTkwRUQzRSIsInZpc2l0b3JfaWQiOiI5MDU1MjU3NDk2NzE3OTQ2MTc0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e8142c4b11a00e33b90a411e02b193f0f2a01968290c965feec62abb90968ccb |
| hovercard-subject-tag | pull_request:2402979338 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/gitpython-developers/GitPython/pull/2015/files |
| twitter:image | https://avatars.githubusercontent.com/u/9417531?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/9417531?s=400&v=4 |
| og:image:alt | It seems this type of properties are not supported by type checkers (mypy, pyright) and using property decorator fixes the issue. commit = property( _get_commit, set_commit, # ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 848bc6032dcc93a9a7301dcc3f379a72ba13b96e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width