René's URL Explorer Experiment


Title: Better document IterableObj.iter_items and improve some subclasses by EliahKagan · Pull Request #1780 · gitpython-developers/GitPython · GitHub

Open Graph Title: Better document IterableObj.iter_items and improve some subclasses by EliahKagan · Pull Request #1780 · gitpython-developers/GitPython

X Title: Better document IterableObj.iter_items and improve some subclasses by EliahKagan · Pull Request #1780 · gitpython-developers/GitPython

Description: Fixes #1775 Fixes #1779 This includes improvements to docstrings, and also other clarity improvements such as reordering methods, in both git.util.IterableObj and the deprecated git.util.Iterable class and its associated metaclass. For #1775, it fills in the missing information. It also rewords the surrounding information, has the less recommended list_items methods' docstrings refer to the more recommended iter_items methods (instead of the other way around), and makes some further changes along those lines detailed in dfee31f. I think that and the other changes in this pull request, documented in commit messages and the above-linked issues this closes, make sense to do together. For #1779, I added tests for some surrounding behavior that did not appear to be under test, as well as extending one of them to be a regression test for that minor bug, before fixing it. I opened #1779 as its own issue rather than documenting here so that, if it turns out that both it and the bigger changes related to #1775 need to be discussed, the discussions are less likely to clash. (But I have no preference as to where such discussion should take place.) There are some possible further changes to git.util.IterableObj and git.util.Iterable that I did not include here because I am not sure if they are wanted, but which I'd be pleased to open another pull request for (or to add to this pull request if preferred): I think it would make sense to put the class that is actually used in GitPython, and that other people should use, first. That is, I think IterableObj should be defined before Iterable. I can see why it's not done that way now: defining Iterable first allows its associated metaclass to be defined next to it, and also for Iterable and IterableObj to be defined next to each other, which may be beneficial since it may make it less likely for their similar docstrings to go out of sync. In IterableObj and Iterable, I think it would be okay for only the methods that are most recommended to give full details about their use, and others to refer to those methods. I made this change partially, moving information that was only in the list_items methods to the iter_items methods. But I propose going further and having the docstrings in the deprecated Iterable class refer to those in IterableObj for their detailed information, at least regarding the effect of omitting or passing extra arguments. I did not do this here because I don't know why the docstrings were near-duplicated in the first place, and perhaps there is a good reason for them to be that way. There would also be the question of whether these comments should be made different or one of them removed, given that the return types they're referring to are not the same: GitPython/git/util.py Lines 1227 to 1228 in d986a59 def iter_items(cls, repo: "Repo", *args: Any, **kwargs: Any) -> Any: # return typed to be compatible with subtypes e.g. Remote GitPython/git/util.py Lines 1265 to 1266 in d986a59 def iter_items(cls, repo: "Repo", *args: Any, **kwargs: Any) -> Iterator[T_IterableObj]: # Iterator[T_IterableObj]: # Return-typed to be compatible with subtypes e.g. Remote. If the second of those suggestions it to be done, then the first can be done too with little to no disadvantage, since it would no longer be necessary to keep their docstrings in sync.

Open Graph Description: Fixes #1775 Fixes #1779 This includes improvements to docstrings, and also other clarity improvements such as reordering methods, in both git.util.IterableObj and the deprecated git.util.Iterable c...

X Description: Fixes #1775 Fixes #1779 This includes improvements to docstrings, and also other clarity improvements such as reordering methods, in both git.util.IterableObj and the deprecated git.util.Iterable c...

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

X: @github

direct link

Domain: redirect.github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:98749404-9aa8-a632-d08c-c0796c5a1ac6
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8BD4:8619D:187C6A:204472:696976D1
html-safe-noncec1b4dfba923bed2408a483f0e1769d9f8ca8a00fd8af16dc700846a25fd9b5d3
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QkQ0Ojg2MTlEOjE4N0M2QToyMDQ0NzI6Njk2OTc2RDEiLCJ2aXNpdG9yX2lkIjoiNzI3MTEwNjcxNDQ5NDY2MjM1MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac80c3535e97a846cec8ba8539c2f4970fb2549f000fb8c8207b96ff4d0f3e01dc
hovercard-subject-tagpull_request:1654931376
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/1780/files
twitter:imagehttps://avatars.githubusercontent.com/u/1771172?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1771172?s=400&v=4
og:image:altFixes #1775 Fixes #1779 This includes improvements to docstrings, and also other clarity improvements such as reordering methods, in both git.util.IterableObj and the deprecated git.util.Iterable c...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonec6f193beb8ff08443adc07685d75302ab8aaf0a135f6e251c3ff3112c8deb881
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
release212e3e3d3298bf5b313830edfd2399e869f7ea76
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://redirect.github.com/gitpython-developers/GitPython/pull/1780/files#start-of-content
https://redirect.github.com/
Sign in https://redirect.github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fpull%2F1780%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://redirect.github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fpull%2F1780%2Ffiles
Sign up https://redirect.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://redirect.github.com/gitpython-developers/GitPython/pull/1780/files
Reloadhttps://redirect.github.com/gitpython-developers/GitPython/pull/1780/files
Reloadhttps://redirect.github.com/gitpython-developers/GitPython/pull/1780/files
gitpython-developers https://redirect.github.com/gitpython-developers
GitPythonhttps://redirect.github.com/gitpython-developers/GitPython
Please reload this pagehttps://redirect.github.com/gitpython-developers/GitPython/pull/1780/files
Notifications https://redirect.github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Fork 964 https://redirect.github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Star 5k https://redirect.github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Code https://redirect.github.com/gitpython-developers/GitPython
Issues 169 https://redirect.github.com/gitpython-developers/GitPython/issues
Pull requests 8 https://redirect.github.com/gitpython-developers/GitPython/pulls
Discussions https://redirect.github.com/gitpython-developers/GitPython/discussions
Actions https://redirect.github.com/gitpython-developers/GitPython/actions
Security Uh oh! There was an error while loading. Please reload this page. https://redirect.github.com/gitpython-developers/GitPython/security
Please reload this pagehttps://redirect.github.com/gitpython-developers/GitPython/pull/1780/files
Insights https://redirect.github.com/gitpython-developers/GitPython/pulse
Code https://redirect.github.com/gitpython-developers/GitPython
Issues https://redirect.github.com/gitpython-developers/GitPython/issues
Pull requests https://redirect.github.com/gitpython-developers/GitPython/pulls
Discussions https://redirect.github.com/gitpython-developers/GitPython/discussions
Actions https://redirect.github.com/gitpython-developers/GitPython/actions
Security https://redirect.github.com/gitpython-developers/GitPython/security
Insights https://redirect.github.com/gitpython-developers/GitPython/pulse
Sign up for GitHub https://redirect.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://redirect.github.com/login?return_to=%2Fgitpython-developers%2FGitPython%2Fissues%2Fnew%2Fchoose
Byronhttps://redirect.github.com/Byron
gitpython-developers:mainhttps://redirect.github.com/gitpython-developers/GitPython/tree/main
EliahKagan:iteritemshttps://redirect.github.com/EliahKagan/GitPython/tree/iteritems
Conversation 2 https://redirect.github.com/gitpython-developers/GitPython/pull/1780
Commits 5 https://redirect.github.com/gitpython-developers/GitPython/pull/1780/commits
Checks 0 https://redirect.github.com/gitpython-developers/GitPython/pull/1780/checks
Files changed 4 https://redirect.github.com/gitpython-developers/GitPython/pull/1780/files
Better document IterableObj.iter_items and improve some subclasses https://redirect.github.com/gitpython-developers/GitPython/pull/1780/files#top
Show all changes 5 commits https://redirect.github.com/gitpython-developers/GitPython/pull/1780/files
53e7383 Remove explicit PushInfo/FetchInfo inheritance from object EliahKagan Dec 22, 2023 https://redirect.github.com/gitpython-developers/GitPython/pull/1780/commits/53e73830f64e13a88b0e246fb825944a6fe2848e
96fc354 Add tests for current Submodule.iter_items behavior EliahKagan Dec 22, 2023 https://redirect.github.com/gitpython-developers/GitPython/pull/1780/commits/96fc3547cf62c5ade1477c24566c8b34254a1507
f5dc1c4 Expand "invalid hash" test to assert normal StopIteration EliahKagan Dec 22, 2023 https://redirect.github.com/gitpython-developers/GitPython/pull/1780/commits/f5dc1c4713dfb937d45d10a595ac879d6e76481c
c3c008c In Submodule.iter_items, don't attach second empty iterator EliahKagan Dec 22, 2023 https://redirect.github.com/gitpython-developers/GitPython/pull/1780/commits/c3c008c4971f9d4189dc08e88334a207ce14298c
dfee31f Improve self-documentation of IterableObj and related classes EliahKagan Dec 22, 2023 https://redirect.github.com/gitpython-developers/GitPython/pull/1780/commits/dfee31f2100d7f4a653c69c4a5a505607fe328e1
Clear filters https://redirect.github.com/gitpython-developers/GitPython/pull/1780/files
Please reload this pagehttps://redirect.github.com/gitpython-developers/GitPython/pull/1780/files
Please reload this pagehttps://redirect.github.com/gitpython-developers/GitPython/pull/1780/files
base.py https://redirect.github.com/gitpython-developers/GitPython/pull/1780/files#diff-44dc32942e129beb7f738ff7d487bfbddb0a7802a91d43c9b8b8952a4d0806bc
remote.py https://redirect.github.com/gitpython-developers/GitPython/pull/1780/files#diff-498082829601479324d7f95e72bd35bafafe74be1b0d8e1b7a42e181b08f3639
util.py https://redirect.github.com/gitpython-developers/GitPython/pull/1780/files#diff-cb13395ac36dd593e722ec548880a091f39732af5c934880144d1a95de67944e
test_submodule.py https://redirect.github.com/gitpython-developers/GitPython/pull/1780/files#diff-78179a32c1d54a6b78b018ee57328d6ea9424fbfbdbb36caf15e290331621024
git/objects/submodule/base.pyhttps://redirect.github.com/gitpython-developers/GitPython/pull/1780/files#diff-44dc32942e129beb7f738ff7d487bfbddb0a7802a91d43c9b8b8952a4d0806bc
View file https://redirect.github.com/EliahKagan/GitPython/blob/dfee31f2100d7f4a653c69c4a5a505607fe328e1/git/objects/submodule/base.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://redirect.github.com/gitpython-developers/GitPython/pull/1780/{{ revealButtonHref }}
https://redirect.github.com/gitpython-developers/GitPython/pull/1780/files#diff-44dc32942e129beb7f738ff7d487bfbddb0a7802a91d43c9b8b8952a4d0806bc
https://redirect.github.com/gitpython-developers/GitPython/pull/1780/files#diff-44dc32942e129beb7f738ff7d487bfbddb0a7802a91d43c9b8b8952a4d0806bc
git/remote.pyhttps://redirect.github.com/gitpython-developers/GitPython/pull/1780/files#diff-498082829601479324d7f95e72bd35bafafe74be1b0d8e1b7a42e181b08f3639
View file https://redirect.github.com/EliahKagan/GitPython/blob/dfee31f2100d7f4a653c69c4a5a505607fe328e1/git/remote.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://redirect.github.com/gitpython-developers/GitPython/pull/1780/{{ revealButtonHref }}
https://redirect.github.com/gitpython-developers/GitPython/pull/1780/files#diff-498082829601479324d7f95e72bd35bafafe74be1b0d8e1b7a42e181b08f3639
https://redirect.github.com/gitpython-developers/GitPython/pull/1780/files#diff-498082829601479324d7f95e72bd35bafafe74be1b0d8e1b7a42e181b08f3639
https://redirect.github.com/gitpython-developers/GitPython/pull/1780/files#diff-498082829601479324d7f95e72bd35bafafe74be1b0d8e1b7a42e181b08f3639
https://redirect.github.com/gitpython-developers/GitPython/pull/1780/files#diff-498082829601479324d7f95e72bd35bafafe74be1b0d8e1b7a42e181b08f3639
git/util.pyhttps://redirect.github.com/gitpython-developers/GitPython/pull/1780/files#diff-cb13395ac36dd593e722ec548880a091f39732af5c934880144d1a95de67944e
View file https://redirect.github.com/EliahKagan/GitPython/blob/dfee31f2100d7f4a653c69c4a5a505607fe328e1/git/util.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://redirect.github.com/gitpython-developers/GitPython/pull/1780/{{ revealButtonHref }}
https://redirect.github.com/gitpython-developers/GitPython/pull/1780/files#diff-cb13395ac36dd593e722ec548880a091f39732af5c934880144d1a95de67944e
https://redirect.github.com/gitpython-developers/GitPython/pull/1780/files#diff-cb13395ac36dd593e722ec548880a091f39732af5c934880144d1a95de67944e
https://redirect.github.com/gitpython-developers/GitPython/pull/1780/files#diff-cb13395ac36dd593e722ec548880a091f39732af5c934880144d1a95de67944e
https://redirect.github.com/gitpython-developers/GitPython/pull/1780/files#diff-cb13395ac36dd593e722ec548880a091f39732af5c934880144d1a95de67944e
test/test_submodule.pyhttps://redirect.github.com/gitpython-developers/GitPython/pull/1780/files#diff-78179a32c1d54a6b78b018ee57328d6ea9424fbfbdbb36caf15e290331621024
View file https://redirect.github.com/EliahKagan/GitPython/blob/dfee31f2100d7f4a653c69c4a5a505607fe328e1/test/test_submodule.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://redirect.github.com/gitpython-developers/GitPython/pull/1780/{{ revealButtonHref }}
https://redirect.github.com/gitpython-developers/GitPython/pull/1780/files#diff-78179a32c1d54a6b78b018ee57328d6ea9424fbfbdbb36caf15e290331621024
https://redirect.github.com/gitpython-developers/GitPython/pull/1780/files#diff-78179a32c1d54a6b78b018ee57328d6ea9424fbfbdbb36caf15e290331621024
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.