René's URL Explorer Experiment


Title: Add types to git/config.py by Yobmod · Pull Request #1234 · gitpython-developers/GitPython · GitHub

Open Graph Title: Add types to git/config.py by Yobmod · Pull Request #1234 · gitpython-developers/GitPython

X Title: Add types to git/config.py by Yobmod · Pull Request #1234 · gitpython-developers/GitPython

Description: Adding types to config.py and cmd.py Functions annotated all listed in commit titles. I had to use a few casts in this one, due to the use of hassattr to distinguish strings from file objects. If anyone knows a better way, let me know. (Its an open issue on mypy, and Guido recomends rewriting and doing type checks - a job for the future!) python/mypy#1424 (comment) Some minor logic changes, all for type checks (e.g. because str is a subtype of Sequence, have to check for it before other sequences) or to try to separate strings from bytes. All check pass and mypy happy. I also ran some basic scripts against it, and no errors. Might be worth cutting a release after this PR, in case an errors are hiding? (No rush, I only submitted this one so fast as it was waiting in my fork already)

Open Graph Description: Adding types to config.py and cmd.py Functions annotated all listed in commit titles. I had to use a few casts in this one, due to the use of hassattr to distinguish strings from file objects. If a...

X Description: Adding types to config.py and cmd.py Functions annotated all listed in commit titles. I had to use a few casts in this one, due to the use of hassattr to distinguish strings from file objects. If a...

Opengraph URL: https://github.com/gitpython-developers/GitPython/pull/1234

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:62eba67d-7dcf-aed9-8b3d-66061ae74a4e
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9A24:1802EE:3C33F03:3CFD21C:69686147
html-safe-nonce3ec5683ede844021efd8a44f4e58039f5b7dcccf4940844e9ea36566a45cb04d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QTI0OjE4MDJFRTozQzMzRjAzOjNDRkQyMUM6Njk2ODYxNDciLCJ2aXNpdG9yX2lkIjoiNDI0MjQ0MDg3ODUzMDUxOTM2NyIsInJlZ2lvbl9lZGdlIjoic2VhIiwicmVnaW9uX3JlbmRlciI6InNlYSJ9
visitor-hmac2d1b07e25cda7b651d16beb7edb976b5780b2185c0a3f3e7cc9fe018b46c7837
hovercard-subject-tagpull_request:643327250
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/gitpython-developers/GitPython/pull/1234/files
twitter:imagehttps://avatars.githubusercontent.com/u/22235459?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/22235459?s=400&v=4
og:image:altAdding types to config.py and cmd.py Functions annotated all listed in commit titles. I had to use a few casts in this one, due to the use of hassattr to distinguish strings from file objects. If a...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None50f46dc2d6192249fd8ebf20e76c800f4f2596d4a5f3ab63dd63a754df154f54
turbo-cache-controlno-preview
diff-viewunified
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 full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasefef287f17234b4529a4b112a3d47fe8551e32ddd
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/gitpython-developers/GitPython/pull/1234/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fpull%2F1234%2Ffiles
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%2Fpull%2F1234%2Ffiles
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%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=gitpython-developers%2FGitPython
Reloadhttps://github.com/gitpython-developers/GitPython/pull/1234/files
Reloadhttps://github.com/gitpython-developers/GitPython/pull/1234/files
Reloadhttps://github.com/gitpython-developers/GitPython/pull/1234/files
gitpython-developers https://github.com/gitpython-developers
GitPythonhttps://github.com/gitpython-developers/GitPython
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/1234/files
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/pull/1234/files
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
Sign up for GitHub https://github.com/signup?return_to=%2Fgitpython-developers%2FGitPython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fgitpython-developers%2FGitPython%2Fissues%2Fnew%2Fchoose
Byronhttps://github.com/Byron
gitpython-developers:mainhttps://github.com/gitpython-developers/GitPython/tree/main
Conversation 1 https://github.com/gitpython-developers/GitPython/pull/1234
Commits 14 https://github.com/gitpython-developers/GitPython/pull/1234/commits
Checks 0 https://github.com/gitpython-developers/GitPython/pull/1234/checks
Files changed https://github.com/gitpython-developers/GitPython/pull/1234/files
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/1234/files
Add types to git/config.py https://github.com/gitpython-developers/GitPython/pull/1234/files#top
Show all changes 14 commits https://github.com/gitpython-developers/GitPython/pull/1234/files
efe6833 Add types to config.py CONFIG_LEVELS, MetaParserBuilder.__new__() .ne… Yobmod May 8, 2021 https://github.com/gitpython-developers/GitPython/pull/1234/commits/efe68337c513c573dde8fbf58337bed2fa2ca39a
6e331a0 Add types to config.py class SectionConstraint Yobmod May 8, 2021 https://github.com/gitpython-developers/GitPython/pull/1234/commits/6e331a0b5e2acd1938bf4906aadf7276bc7f1b60
e21d96a Add types to config.py class _OMD Yobmod May 8, 2021 https://github.com/gitpython-developers/GitPython/pull/1234/commits/e21d96a76c223064a3b351fe062d5452da7670cd
efc2598 Add types to config.py GitConfigParser .__init__() .aquire_lock() Yobmod May 8, 2021 https://github.com/gitpython-developers/GitPython/pull/1234/commits/efc259833ee184888fe21105d63b3c2aa3d51cfa
94b7ece Add types to config.py GitConfigParser .release() ._read() ._has_incl… Yobmod May 8, 2021 https://github.com/gitpython-developers/GitPython/pull/1234/commits/94b7ece1794901feddf98fcac3a672f81aa6a6e1
c6e458c Add types to config.py GitConfigParser .read() Yobmod May 9, 2021 https://github.com/gitpython-developers/GitPython/pull/1234/commits/c6e458c9f8682ab5091e15e637c66ad6836f23b4
ab69b9a Add types to config.py GitConfigParser .write() ._write() .items() .i… Yobmod May 9, 2021 https://github.com/gitpython-developers/GitPython/pull/1234/commits/ab69b9a67520f18dd8efd338e6e599a77b46bb34
c2f9f4e Add types to config.py GitConfigParser ._assure_writable .add_section… Yobmod May 9, 2021 https://github.com/gitpython-developers/GitPython/pull/1234/commits/c2f9f4e7fd8af09126167fd1dfa151be4fedcd71
3473060 Add typing section to cmd.py Yobmod May 12, 2021 https://github.com/gitpython-developers/GitPython/pull/1234/commits/3473060f4b356a6c8ed744ba17ad9aa26ef6aab7
887f249 Add types to cmd.py Git Yobmod May 12, 2021 https://github.com/gitpython-developers/GitPython/pull/1234/commits/887f249a2241d45765437b295b46bca1597d91a3
f1ace25 Add types to cmd.py AutoInterrupt Yobmod May 12, 2021 https://github.com/gitpython-developers/GitPython/pull/1234/commits/f1ace258417deae329880754987851b1b8fc0a7a
39eb0e6 Add types to cmd.py CatFileContentStream Yobmod May 12, 2021 https://github.com/gitpython-developers/GitPython/pull/1234/commits/39eb0e607f86537929a372f3ef33c9721984565a
f62c8d8 Add types to cmd.py Git Yobmod May 12, 2021 https://github.com/gitpython-developers/GitPython/pull/1234/commits/f62c8d8bbb566edd9e7a40155c7380944cf65dfb
96c4365 flake8 and mypy fixes Yobmod May 13, 2021 https://github.com/gitpython-developers/GitPython/pull/1234/commits/96c43652c9f5b11b611e1aca0a6d67393e9e38c1
Clear filters https://github.com/gitpython-developers/GitPython/pull/1234/files
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/1234/files
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/1234/files
cmd.py https://github.com/gitpython-developers/GitPython/pull/1234/files#diff-35a18a749eb4d6efad45e56e78a9554926be5526e2ba2159b44311e718450e88
compat.py https://github.com/gitpython-developers/GitPython/pull/1234/files#diff-2f2b548c14a71e5bbf15502f6d7fd98a50842119152c451ae2ec5e1cc42f02d2
config.py https://github.com/gitpython-developers/GitPython/pull/1234/files#diff-dd51b67c435dfba6f72cc0d08f99456393556623a0f098ac2808d1a7cb78d53a
diff.py https://github.com/gitpython-developers/GitPython/pull/1234/files#diff-300633890a1b325dfed86bb5120d89465f0687f4f6b8d5701c44c02f0eee723a
exc.py https://github.com/gitpython-developers/GitPython/pull/1234/files#diff-1eee00ab107f6bfb1dedb97cf16cbd369028c3382cd80deb8e0c902fff9536b0
base.py https://github.com/gitpython-developers/GitPython/pull/1234/files#diff-3cc1aaf2f1e2bc1341d3f71ceec44b2762b981280b4d162e26327bd558721fe1
types.py https://github.com/gitpython-developers/GitPython/pull/1234/files#diff-7b61e3545630e0a388178487cb7018546b39eb3f92e6553c18c3c3e11300cfda
util.py https://github.com/gitpython-developers/GitPython/pull/1234/files#diff-cb13395ac36dd593e722ec548880a091f39732af5c934880144d1a95de67944e
git/cmd.pyhttps://github.com/gitpython-developers/GitPython/pull/1234/files#diff-35a18a749eb4d6efad45e56e78a9554926be5526e2ba2159b44311e718450e88
View file https://github.com/gitpython-developers/GitPython/blob/96c43652c9f5b11b611e1aca0a6d67393e9e38c1/git/cmd.py
Open in desktop https://desktop.github.com
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/1234/files
git/compat.pyhttps://github.com/gitpython-developers/GitPython/pull/1234/files#diff-2f2b548c14a71e5bbf15502f6d7fd98a50842119152c451ae2ec5e1cc42f02d2
View file https://github.com/gitpython-developers/GitPython/blob/96c43652c9f5b11b611e1aca0a6d67393e9e38c1/git/compat.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/gitpython-developers/GitPython/pull/1234/{{ revealButtonHref }}
https://github.com/gitpython-developers/GitPython/pull/1234/files#diff-2f2b548c14a71e5bbf15502f6d7fd98a50842119152c451ae2ec5e1cc42f02d2
https://github.com/gitpython-developers/GitPython/pull/1234/files#diff-2f2b548c14a71e5bbf15502f6d7fd98a50842119152c451ae2ec5e1cc42f02d2
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/1234/files
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.