René's URL Explorer Experiment


Title: gh-91485: Doc: Using Python syntax to document builtin Python functions. by JulienPalard · Pull Request #96579 · python/cpython · GitHub

Open Graph Title: gh-91485: Doc: Using Python syntax to document builtin Python functions. by JulienPalard · Pull Request #96579 · python/cpython

X Title: gh-91485: Doc: Using Python syntax to document builtin Python functions. by JulienPalard · Pull Request #96579 · python/cpython

Description: I tried my idea at documenting Python functions using only Python syntax (avoiding manpages-like brackets to denote optional arguments), please tell me what you think. It sometimes went "badly", like: -.. class:: set([iterable]) +.. class:: set(iterable=()) where I "had" to use an empty tuple because it would have looked very recursive to use a set here, like set(iterable=set()). It's also a lie: it's not an empty tuple by default (it's a C NULL), but there's no practical difference for the reader. Sometimes the change is more neutral, like in: -.. awaitablefunction:: anext(async_iterator[, default]) +.. awaitablefunction:: anext(async_iterator) + anext(async_iterator, default) or: -.. function:: max(iterable, *[, key, default]) - max(arg1, arg2, *args[, key]) +.. function:: max(iterable, /, *, key=None) + max(iterable, /, *, default, key=None) + max(arg1, arg2, *args, key=None) (where I'm happy to remove , *[, because it hurt my eyes.) Sometimes it's good as it add information: -.. class:: complex([real[, imag]]) +.. class:: complex(real=0, imag=0) Or make more explicit where it's OK to pass None and where it's not, like in: -.. class:: super([type[, object-or-type]]) +.. class:: super() + super(type, object_or_type=None) I bet you think « People should know this syntax, or learn it anyway », but I don't think so, I mean yes they will learn it anyway, but why forcing them to learn it at the same time as they learn basic Python functions? Learning one thing at a time is complicated enough. Many are alone facing those pages and showing them: complex(real=0, imag=0) teach them how to implement default arguments in their own functions, and explicitly show them what happen when they don't give the values, while: complex([real[, imag]]) don't. Issue: gh-91485

Open Graph Description: I tried my idea at documenting Python functions using only Python syntax (avoiding manpages-like brackets to denote optional arguments), please tell me what you think. It sometimes went "badly...

X Description: I tried my idea at documenting Python functions using only Python syntax (avoiding manpages-like brackets to denote optional arguments), please tell me what you think. It sometimes went "b...

Opengraph URL: https://github.com/python/cpython/pull/96579

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:e1a6a487-09cf-8330-14ef-1e6be2952de9
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC024:162B2:591C078:7DEBDF4:6A4FC12C
html-safe-nonce63a38a0351bcdf498279322e02fb5ee2e71e2d06b6015fc4a0e5b46741301498
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMDI0OjE2MkIyOjU5MUMwNzg6N0RFQkRGNDo2QTRGQzEyQyIsInZpc2l0b3JfaWQiOiIzNjkxNzM3NDgzMjAzMDM1NDM3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacea279d7c1631f934c4aab9f05b6120b230c1af01d97d142387aa4538aaea8103
hovercard-subject-tagpull_request:1046422134
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/python/cpython/pull/96579/files
twitter:imagehttps://avatars.githubusercontent.com/u/239510?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/239510?s=400&v=4
og:image:altI tried my idea at documenting Python functions using only Python syntax (avoiding manpages-like brackets to denote optional arguments), please tell me what you think. It sometimes went "badly...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None7d8f8209b188a80e19a6957836ab9229715797be5db1a04163963c674ccc33f6
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseea848e83cf3bf3613dd7b13d52965a684fd23ec5
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/96579/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F96579%2Ffiles
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
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%2Fpython%2Fcpython%2Fpull%2F96579%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=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/96579/files
Reloadhttps://github.com/python/cpython/pull/96579/files
Reloadhttps://github.com/python/cpython/pull/96579/files
Please reload this pagehttps://github.com/python/cpython/pull/96579/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/96579/files
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 34.8k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 73.6k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.3k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality 0 https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
JulienPalardhttps://github.com/JulienPalard
python:mainhttps://github.com/python/cpython/tree/main
JulienPalard:mdk-stick-to-python-syntaxhttps://github.com/JulienPalard/cpython/tree/mdk-stick-to-python-syntax
Conversation 23 https://github.com/python/cpython/pull/96579
Commits 12 https://github.com/python/cpython/pull/96579/commits
Checks 0 https://github.com/python/cpython/pull/96579/checks
Files changed https://github.com/python/cpython/pull/96579/files
Please reload this pagehttps://github.com/python/cpython/pull/96579/files
gh-91485: Doc: Using Python syntax to document builtin Python functions. https://github.com/python/cpython/pull/96579/files#top
Show all changes 12 commits https://github.com/python/cpython/pull/96579/files
2abd2d3 Doc: Using Python syntax to document builtin Python functions. JulienPalard Sep 5, 2022 https://github.com/python/cpython/pull/96579/commits/2abd2d3a75a4cda5b85577148861487187898c46
baf3065 Update Doc/library/functions.rst JulienPalard Sep 6, 2022 https://github.com/python/cpython/pull/96579/commits/baf30657b65d788739f213ed5d140b9719439112
71c909f Added a newline by mistake. JulienPalard Sep 6, 2022 https://github.com/python/cpython/pull/96579/commits/71c909fd197413d32cf228569d4e773277eb4a44
82bf578 Avoid messing around fake default argument. JulienPalard Sep 22, 2022 https://github.com/python/cpython/pull/96579/commits/82bf5781d179ab17eff17bbe92ba6ba4b8ba4df3
edbfcd6 Update Doc/library/functions.rst JulienPalard Oct 13, 2022 https://github.com/python/cpython/pull/96579/commits/edbfcd6780891cbfc09281717013ce5ee00ae675
92a3bb0 Try to be exhaustive about what can and can't be done with builtins. JulienPalard Oct 13, 2022 https://github.com/python/cpython/pull/96579/commits/92a3bb01d98940df430d7763ab5a9caf3191db55
2d3e6df Update Doc/library/functions.rst JulienPalard Oct 13, 2022 https://github.com/python/cpython/pull/96579/commits/2d3e6df7565270f2739a48df01e5384ed1634c49
3dd97eb Update Doc/library/functions.rst JulienPalard Oct 13, 2022 https://github.com/python/cpython/pull/96579/commits/3dd97ebdd7069ef34cdc2d867c78ed5b4362e9d1
f6457e7 Complex can take a string, thanks AA-Turner. JulienPalard Oct 13, 2022 https://github.com/python/cpython/pull/96579/commits/f6457e795e925ea6886a7da5fe22661a5b72bf24
7aca0e5 FIX: map prototype. JulienPalard Oct 13, 2022 https://github.com/python/cpython/pull/96579/commits/7aca0e534a16c541f1f6fc7ba94b967da0f1d5a1
b289475 iterable can't be given by name. JulienPalard Oct 13, 2022 https://github.com/python/cpython/pull/96579/commits/b289475b4d235c67a7e55e6697906445ec41585d
fb11b2d There's no arguments that can be named here, so this slash was useless. JulienPalard Oct 13, 2022 https://github.com/python/cpython/pull/96579/commits/fb11b2d4e536ebd5eb2a040dfbd553302345565c
Clear filters https://github.com/python/cpython/pull/96579/files
Please reload this pagehttps://github.com/python/cpython/pull/96579/files
Please reload this pagehttps://github.com/python/cpython/pull/96579/files
Please reload this pagehttps://github.com/python/cpython/pull/96579/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.