Title: git.types.PathLike is partially unknown for Pylance/mypy · Issue #1473 · gitpython-developers/GitPython · GitHub
Open Graph Title: git.types.PathLike is partially unknown for Pylance/mypy · Issue #1473 · gitpython-developers/GitPython
X Title: git.types.PathLike is partially unknown for Pylance/mypy · Issue #1473 · gitpython-developers/GitPython
Description: Hello everyone, I am using GitPython in my project and I use Pylance/mypy with the strict type checking settings. This setting is pretty important for my project's sanity. As I've been using methods from GitPython that make uses of paths...
Open Graph Description: Hello everyone, I am using GitPython in my project and I use Pylance/mypy with the strict type checking settings. This setting is pretty important for my project's sanity. As I've been using method...
X Description: Hello everyone, I am using GitPython in my project and I use Pylance/mypy with the strict type checking settings. This setting is pretty important for my project's sanity. As I've been usin...
Opengraph URL: https://github.com/gitpython-developers/GitPython/issues/1473
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"git.types.PathLike is partially unknown for Pylance/mypy","articleBody":"Hello everyone,\r\n\r\nI am using GitPython in my project and I use Pylance/mypy with the strict type checking settings. This setting is pretty important for my project's sanity.\r\n\r\nAs I've been using methods from GitPython that make uses of paths, I've been getting the following errors:\r\n\r\nAs you can notice, what raises this error is `PathLike[Unknown]`, defined in `git.types.PathLike`. ([Source file \u0026 lines](https://github.com/gitpython-developers/GitPython/blob/main/git/types.py#L47-L51))\r\n\r\nAfter further investigation, I've found out that this is because `os.PathLike` is considered as a generic class (Like `typing.List`, `typing.Dict` and so on)\r\n\r\n\r\nThe fix is fairly simple, as it is to simply allow `str` for `PathLike`, which gives this result: `os.PathLike[str]`\r\n\r\n\r\n\r\n(awesome! This issue's no longer a thing with this fix!)\r\n\r\nThere has some discussion about the same situation on this StackOverflow page: https://stackoverflow.com/a/69680089/13720113\r\n\r\nI can make a PR for fixing this (Of course, with some testing, since there is Python version checks), as long as this issue is approved.\r\n\r\nThank you, hoping this issue get sorted soon! ","author":{"url":"https://github.com/madebylydia","@type":"Person","name":"madebylydia"},"datePublished":"2022-07-26T01:28:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/1473/GitPython/issues/1473"}
| 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:81682489-8c7d-6a73-5ed3-c79a97f3a6e2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BC8A:2DBAFB:2ECC1F0:3D8B6C9:696CFDF6 |
| html-safe-nonce | 72948b65546b8ab97bfccaf0fc5e8c26757fec7576aa2da15be241c1724b725e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzhBOjJEQkFGQjoyRUNDMUYwOjNEOEI2Qzk6Njk2Q0ZERjYiLCJ2aXNpdG9yX2lkIjoiNzM5MTUyMTkxMjI1NDE2ODU2NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2524e3591472a489f3d7572f2213360b0c08f66c8ca66c143a886770d7066967 |
| hovercard-subject-tag | issue:1317578079 |
| 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/1473/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f14d683328aa4450a1a7861d7732de426ced0b30357f4555c8147606557c3c61/gitpython-developers/GitPython/issues/1473 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f14d683328aa4450a1a7861d7732de426ced0b30357f4555c8147606557c3c61/gitpython-developers/GitPython/issues/1473 |
| og:image:alt | Hello everyone, I am using GitPython in my project and I use Pylance/mypy with the strict type checking settings. This setting is pretty important for my project's sanity. As I've been using method... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | madebylydia |
| hostname | github.com |
| expected-hostname | github.com |
| None | 31994babd8463b50f2371f63aab0826561f4efe3981ac0ebc4c33e6c41032dbd |
| 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 | f5a202c3c4aefc9cf00c8c78951a1e72eaebebeb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width