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: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:0ce4832b-4287-f387-236f-9780517bd0d6 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 82A8:203CDE:372D815:37D5B78:69685261 |
| html-safe-nonce | f84952f6ab7333ce415d901e402fe34a516b76ba3e01387c299d5b1739f7dfd1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MkE4OjIwM0NERTozNzJEODE1OjM3RDVCNzg6Njk2ODUyNjEiLCJ2aXNpdG9yX2lkIjoiNDgwNjUyOTc0NTYwOTU3NzA1NyIsInJlZ2lvbl9lZGdlIjoic2VhIiwicmVnaW9uX3JlbmRlciI6InNlYSJ9 |
| visitor-hmac | f2f16d8917d168c923fd2fc17bbfb7ac6f6a2b2c467af149406632a3ea4d55a0 |
| 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 | f16c57f41ed243e5b4dfe9b9bcd6828bd83080b1b6dbb4ff239bbe9745f12e0c |
| 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 | cfa7062cc6d4fe8fcb156bd33f4c97bd3b2470af |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width