René's URL Explorer Experiment


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

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@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![mypy raising an error for git.types.PathLike](https://user-images.githubusercontent.com/61093863/180901876-4f47a5a3-697d-4338-8008-77e075d13266.png)\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![Image showing PathLike being a generic class](https://user-images.githubusercontent.com/61093863/180902236-75621c2a-fdb5-4bd8-b603-6fb0adef0399.png)\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![PathLike with the implemented fix](https://user-images.githubusercontent.com/61093863/180902659-51b11455-6150-4596-b866-d36b3ac6a767.png)\r\n![Actual code without any errors](https://user-images.githubusercontent.com/61093863/180902715-5d1fb7af-214a-45eb-96e3-6e442ce13f19.png)\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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:81682489-8c7d-6a73-5ed3-c79a97f3a6e2
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBC8A:2DBAFB:2ECC1F0:3D8B6C9:696CFDF6
html-safe-nonce72948b65546b8ab97bfccaf0fc5e8c26757fec7576aa2da15be241c1724b725e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzhBOjJEQkFGQjoyRUNDMUYwOjNEOEI2Qzk6Njk2Q0ZERjYiLCJ2aXNpdG9yX2lkIjoiNzM5MTUyMTkxMjI1NDE2ODU2NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac2524e3591472a489f3d7572f2213360b0c08f66c8ca66c143a886770d7066967
hovercard-subject-tagissue:1317578079
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/gitpython-developers/GitPython/1473/issue_layout
twitter:imagehttps://opengraph.githubassets.com/f14d683328aa4450a1a7861d7732de426ced0b30357f4555c8147606557c3c61/gitpython-developers/GitPython/issues/1473
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f14d683328aa4450a1a7861d7732de426ced0b30357f4555c8147606557c3c61/gitpython-developers/GitPython/issues/1473
og:image:altHello 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:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemadebylydia
hostnamegithub.com
expected-hostnamegithub.com
None31994babd8463b50f2371f63aab0826561f4efe3981ac0ebc4c33e6c41032dbd
turbo-cache-controlno-preview
go-importgithub.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git
octolytics-dimension-user_id503709
octolytics-dimension-user_logingitpython-developers
octolytics-dimension-repository_id1126087
octolytics-dimension-repository_nwogitpython-developers/GitPython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1126087
octolytics-dimension-repository_network_root_nwogitpython-developers/GitPython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef5a202c3c4aefc9cf00c8c78951a1e72eaebebeb
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/gitpython-developers/GitPython/issues/1473#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fissues%2F1473
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fissues%2F1473
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=gitpython-developers%2FGitPython
Reloadhttps://github.com/gitpython-developers/GitPython/issues/1473
Reloadhttps://github.com/gitpython-developers/GitPython/issues/1473
Reloadhttps://github.com/gitpython-developers/GitPython/issues/1473
gitpython-developers https://github.com/gitpython-developers
GitPythonhttps://github.com/gitpython-developers/GitPython
Please reload this pagehttps://github.com/gitpython-developers/GitPython/issues/1473
Notifications https://github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Fork 964 https://github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Star 5k https://github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Code https://github.com/gitpython-developers/GitPython
Issues 169 https://github.com/gitpython-developers/GitPython/issues
Pull requests 8 https://github.com/gitpython-developers/GitPython/pulls
Discussions https://github.com/gitpython-developers/GitPython/discussions
Actions https://github.com/gitpython-developers/GitPython/actions
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/gitpython-developers/GitPython/security
Please reload this pagehttps://github.com/gitpython-developers/GitPython/issues/1473
Insights https://github.com/gitpython-developers/GitPython/pulse
Code https://github.com/gitpython-developers/GitPython
Issues https://github.com/gitpython-developers/GitPython/issues
Pull requests https://github.com/gitpython-developers/GitPython/pulls
Discussions https://github.com/gitpython-developers/GitPython/discussions
Actions https://github.com/gitpython-developers/GitPython/actions
Security https://github.com/gitpython-developers/GitPython/security
Insights https://github.com/gitpython-developers/GitPython/pulse
New issuehttps://github.com/login?return_to=https://github.com/gitpython-developers/GitPython/issues/1473
New issuehttps://github.com/login?return_to=https://github.com/gitpython-developers/GitPython/issues/1473
#1474https://github.com/gitpython-developers/GitPython/pull/1474
git.types.PathLike is partially unknown for Pylance/mypyhttps://github.com/gitpython-developers/GitPython/issues/1473#top
#1474https://github.com/gitpython-developers/GitPython/pull/1474
acknowledgedhttps://github.com/gitpython-developers/GitPython/issues?q=state%3Aopen%20label%3A%22acknowledged%22
c-typingMypy causes warnings or errors when runhttps://github.com/gitpython-developers/GitPython/issues?q=state%3Aopen%20label%3A%22c-typing%22
help wantedhttps://github.com/gitpython-developers/GitPython/issues?q=state%3Aopen%20label%3A%22help%20wanted%22
https://github.com/madebylydia
https://github.com/madebylydia
madebylydiahttps://github.com/madebylydia
on Jul 26, 2022https://github.com/gitpython-developers/GitPython/issues/1473#issue-1317578079
https://user-images.githubusercontent.com/61093863/180901876-4f47a5a3-697d-4338-8008-77e075d13266.png
Source file & lineshttps://github.com/gitpython-developers/GitPython/blob/main/git/types.py#L47-L51
https://user-images.githubusercontent.com/61093863/180902236-75621c2a-fdb5-4bd8-b603-6fb0adef0399.png
https://user-images.githubusercontent.com/61093863/180902659-51b11455-6150-4596-b866-d36b3ac6a767.png
https://user-images.githubusercontent.com/61093863/180902715-5d1fb7af-214a-45eb-96e3-6e442ce13f19.png
https://stackoverflow.com/a/69680089/13720113https://stackoverflow.com/a/69680089/13720113
acknowledgedhttps://github.com/gitpython-developers/GitPython/issues?q=state%3Aopen%20label%3A%22acknowledged%22
c-typingMypy causes warnings or errors when runhttps://github.com/gitpython-developers/GitPython/issues?q=state%3Aopen%20label%3A%22c-typing%22
help wantedhttps://github.com/gitpython-developers/GitPython/issues?q=state%3Aopen%20label%3A%22help%20wanted%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.