René's URL Explorer Experiment


Title: Docstrings of "protected" members that are part of interfaces should be rendered · Issue #1848 · gitpython-developers/GitPython · GitHub

Open Graph Title: Docstrings of "protected" members that are part of interfaces should be rendered · Issue #1848 · gitpython-developers/GitPython

X Title: Docstrings of "protected" members that are part of interfaces should be rendered · Issue #1848 · gitpython-developers/GitPython

Description: GitPython classes contain a number of conceptually "protected" methods that can reasonably be called by code in subclasses (including in subclasses' overridden implementations of them) but not by arbitrary other code. By default, Sphinx ...

Open Graph Description: GitPython classes contain a number of conceptually "protected" methods that can reasonably be called by code in subclasses (including in subclasses' overridden implementations of them) but not by a...

X Description: GitPython classes contain a number of conceptually "protected" methods that can reasonably be called by code in subclasses (including in subclasses' overridden implementations of them...

Opengraph URL: https://github.com/gitpython-developers/GitPython/issues/1848

X: @github

direct link

Domain: Github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Docstrings of \"protected\" members that are part of interfaces should be rendered","articleBody":"GitPython classes contain a number of conceptually \"protected\" methods that can reasonably be called by code in subclasses (including in subclasses' overridden implementations of them) but not by arbitrary other code.\r\n\r\nBy default, Sphinx [autodoc](https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html) does not render documentation for entities that start with `_`. That makes sense for conceptually \"private\" things that don't make sense for outside code to call and that could, without warning, change or be removed at any time. But for \"protected\" methods, in order to correctly use them, it is useful to have documentation.\r\n\r\nAs one example, the public [`git.objects.tree.Tree.traverse`](https://gitpython.readthedocs.io/en/latest/reference.html#git.objects.tree.Tree.traverse) method has this as its docstring:\r\n\r\nhttps://github.com/gitpython-developers/GitPython/blob/fe1934c5c90e617d49a38a6c36b1eb17dea47013/git/objects/tree.py#L295-L298\r\n\r\nAlthough that can (and should) be made into a `:meth:` reference to [`Traversable._traverse`](https://github.com/gitpython-developers/GitPython/blob/fe1934c5c90e617d49a38a6c36b1eb17dea47013/git/objects/util.py#L444), doing so will not cause it to link to an rendered docstring for `Traversable._traverse`, because the `_traverse` method is non-public and there is currently nothing to link to for it in the rendered Sphinx documentation.\r\n\r\nThis could be mitigated in some specific cases by copying or moving documentation to fully public methods. For example, the `Tree.traverse` method could have all the relevant information present in the `Traversable._traverse` method. This would risk that information becoming out of date or otherwise confusing if it ends up being updated in one place but not another. But the real issue is that conceptually \"protected\" methods that document how they are and are not supposed to be used should--whether or not they are referenced in any other docstrings--be part of the rendered Sphinx documentation.\r\n\r\nSphinx autodoc generation is controlled by the code in `reference.rst` for each section of the reference manual. Currently most sections take the form:\r\n\r\nhttps://github.com/gitpython-developers/GitPython/blob/fe1934c5c90e617d49a38a6c36b1eb17dea47013/doc/source/reference.rst?plain=1#L48-L51\r\n\r\nSphinx autodoc supports [`:private-members:`](https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#directive-option-automodule-private-members), which can be used to emit documentation for just some specifically named non-public members (rather than all) by giving them as arguments. But I suspect that this may not be the best way to do it. Each entity in GitPython that has specific documentation currently has it in the form of a docstring on that entity. So if possible, this should be controlled from the docstrings themselves. (Of course, if this is not feasible, then it is better to list them explicitly in `reference.rst` than to keep their documentation omitted forever.)\r\n\r\nFixing this may help with #1834, especially if the non-`None` usage to be documented is not going to be deprecated, since the recommendation to prefer returning `None` will probably have to be written in the docstring, and for this to really be clear the docstring should be rendered. However, I don't think this needs to be seen as a blocker for that, and I don't want to discourage anyone from fixing #1834 at any time.\r\n\r\nFinally, note that sometimes the word \"protected\" is used in Python jargon to mean methods named like `_foo` rather than `__foo`. That's not what I mean; I am using this word in the traditional OOP sense to refer to members that are considered part of the interface for subclasses but not part of the interface more broadly. Most `_foo` methods in GitPython are conceptually private and should not have their docstrings emitted by Sphinx.","author":{"url":"https://github.com/EliahKagan","@type":"Person","name":"EliahKagan"},"datePublished":"2024-02-27T17:27:07.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1848/GitPython/issues/1848"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:f6ec2c41-edff-b5be-c8dd-66510f2f6719
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB6E8:6E24C:7EF026:B01349:6A624576
html-safe-nonce8f69fa30b0caec794e93c3cd0fdcb3d5402d9421d9e5fc42d0beeb8d1963c610
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNkU4OjZFMjRDOjdFRjAyNjpCMDEzNDk6NkE2MjQ1NzYiLCJ2aXNpdG9yX2lkIjoiOTA5MzkzOTg2MTk4NTA1MjAyMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac0dda2d1b0c5ce7fd06e4ad96e15f2517b6dbf32eb2c442ec5cf13165a8facae1
hovercard-subject-tagissue:2157236111
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/1848/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2b376f9200456469b69a65f31364d8f9a259bead1f42fe23fb9f7ba09dbc6f63/gitpython-developers/GitPython/issues/1848
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2b376f9200456469b69a65f31364d8f9a259bead1f42fe23fb9f7ba09dbc6f63/gitpython-developers/GitPython/issues/1848
og:image:altGitPython classes contain a number of conceptually "protected" methods that can reasonably be called by code in subclasses (including in subclasses' overridden implementations of them) but not by a...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameEliahKagan
hostnamegithub.com
expected-hostnamegithub.com
None5d6ba65d73ecc4e3394fe318d2b2f98e6f8eed4878b5421b938e20d30bde267b
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
release2dadc56fd5989b76a8ae7304e3aa56d0b485e5dc
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://Github.com/gitpython-developers/GitPython/issues/1848#start-of-content
https://Github.com/
Sign in https://Github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fissues%2F1848
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
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
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
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
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
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/enterprise/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%2F1848
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/1848
Reloadhttps://Github.com/gitpython-developers/GitPython/issues/1848
Reloadhttps://Github.com/gitpython-developers/GitPython/issues/1848
Please reload this pagehttps://Github.com/gitpython-developers/GitPython/issues/1848
gitpython-developers https://Github.com/gitpython-developers
GitPythonhttps://Github.com/gitpython-developers/GitPython
Please reload this pagehttps://Github.com/gitpython-developers/GitPython/issues/1848
Notifications https://Github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Fork 983 https://Github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Star 5.1k https://Github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Code https://Github.com/gitpython-developers/GitPython
Issues 15 https://Github.com/gitpython-developers/GitPython/issues
Pull requests 4 https://Github.com/gitpython-developers/GitPython/pulls
Discussions https://Github.com/gitpython-developers/GitPython/discussions
Actions https://Github.com/gitpython-developers/GitPython/actions
Security and quality 17 https://Github.com/gitpython-developers/GitPython/security
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 and quality https://Github.com/gitpython-developers/GitPython/security
Insights https://Github.com/gitpython-developers/GitPython/pulse
Taskhttps://Github.com/gitpython-developers/GitPython/issues?q=type:"Task"
Docstrings of "protected" members that are part of interfaces should be renderedhttps://Github.com/gitpython-developers/GitPython/issues/1848#top
acknowledgedhttps://github.com/gitpython-developers/GitPython/issues?q=state%3Aopen%20label%3A%22acknowledged%22
help wantedhttps://github.com/gitpython-developers/GitPython/issues?q=state%3Aopen%20label%3A%22help%20wanted%22
https://github.com/EliahKagan
EliahKaganhttps://github.com/EliahKagan
on Feb 27, 2024https://github.com/gitpython-developers/GitPython/issues/1848#issue-2157236111
autodochttps://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html
git.objects.tree.Tree.traversehttps://gitpython.readthedocs.io/en/latest/reference.html#git.objects.tree.Tree.traverse
GitPython/git/objects/tree.pyhttps://github.com/gitpython-developers/GitPython/blob/fe1934c5c90e617d49a38a6c36b1eb17dea47013/git/objects/tree.py#L295-L298
fe1934chttps://Github.com/gitpython-developers/GitPython/commit/fe1934c5c90e617d49a38a6c36b1eb17dea47013
Traversable._traversehttps://github.com/gitpython-developers/GitPython/blob/fe1934c5c90e617d49a38a6c36b1eb17dea47013/git/objects/util.py#L444
GitPython/doc/source/reference.rsthttps://github.com/gitpython-developers/GitPython/blob/fe1934c5c90e617d49a38a6c36b1eb17dea47013/doc/source/reference.rst?plain=1#L48-L51
fe1934chttps://Github.com/gitpython-developers/GitPython/commit/fe1934c5c90e617d49a38a6c36b1eb17dea47013
:private-members:https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#directive-option-automodule-private-members
#1834https://github.com/gitpython-developers/GitPython/issues/1834
#1834https://github.com/gitpython-developers/GitPython/issues/1834
acknowledgedhttps://github.com/gitpython-developers/GitPython/issues?q=state%3Aopen%20label%3A%22acknowledged%22
help wantedhttps://github.com/gitpython-developers/GitPython/issues?q=state%3Aopen%20label%3A%22help%20wanted%22
Taskhttps://Github.com/gitpython-developers/GitPython/issues?q=type:"Task"
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.