René's URL Explorer Experiment


Title: Should stubs contain default values? · Issue #8988 · python/typeshed · GitHub

Open Graph Title: Should stubs contain default values? · Issue #8988 · python/typeshed

X Title: Should stubs contain default values? · Issue #8988 · python/typeshed

Description: This has come up recently, for similar reasons as #4881 and discussed a little there From @gramster an advantage of including default values is that tools like pyright or pylance will use stubs (if available) for the signatures they show...

Open Graph Description: This has come up recently, for similar reasons as #4881 and discussed a little there From @gramster an advantage of including default values is that tools like pyright or pylance will use stubs (if...

X Description: This has come up recently, for similar reasons as #4881 and discussed a little there From @gramster an advantage of including default values is that tools like pyright or pylance will use stubs (if...

Opengraph URL: https://github.com/python/typeshed/issues/8988

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Should stubs contain default values?","articleBody":"This has come up recently, for similar reasons as #4881 and discussed a little there\r\n\r\nFrom @gramster\r\n> an advantage of including default values is that tools like pyright or pylance will use stubs (if available) for the signatures they show to users when hovering over a function call, and users want to see the default values. I'd like to understand your point of view though as to why you would prefer them removed?\r\n\r\nI'm overall fine with this, though I'd like to see the following:\r\n- we restrict it to simple literal values (e.g. anything that can go into a Literal)\r\n- we can still use `...` at author's discretion (useful in overloads or cases where value doesn't actually matter or to avoid awful `x: Literal[\"x\"] = \"x\"` things)\r\n- we update e.g. stubtest to verify stuff\r\n\r\nThe case for:\r\n- lets IDEs provide more information to users\r\n\r\nThe case against:\r\n- most things are longer than `...` and terseness may be more valuable than the additional information\r\n- it's a thing that needs doing and maintaining\r\n- if we allow complicated default values there are more costs\r\n\r\nA similar thing could apply to constants.","author":{"url":"https://github.com/hauntsaninja","@type":"Person","name":"hauntsaninja"},"datePublished":"2022-10-26T01:47:05Z","url":"https://github.com/python/typeshed/issues/8988"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:2de88525-a678-0984-cad1-573f8fa31255
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAFF6:163716:B8F633:F829BC:6AFFA7BC
html-safe-nonce71831e41e87cd73a1153d268319d71ba4ee25cc5e15c8d7b6b0927f47654cd3a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRkY2OjE2MzcxNjpCOEY2MzM6RjgyOUJDOjZBRkZBN0JDIiwidmlzaXRvcl9pZCI6IjIwMDg0NzY1Nzc5OTM1NjYxNDAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac70cb9b0940619e6f1688a99852ba35139bfbaa2571a4cca022470fe72535409e
hovercard-subject-tagissue:1423314488
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/python/typeshed/8988/issue_layout
twitter:imagehttps://opengraph.githubassets.com/763ca4780ba7f561234fc5783f02923766a5d547c6bb173c93dec7df77617f06/python/typeshed/issues/8988
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/763ca4780ba7f561234fc5783f02923766a5d547c6bb173c93dec7df77617f06/python/typeshed/issues/8988
og:image:altThis has come up recently, for similar reasons as #4881 and discussed a little there From @gramster an advantage of including default values is that tools like pyright or pylance will use stubs (if...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamehauntsaninja
hostnamegithub.com
expected-hostnamegithub.com
None6a41d7f592f24f38b58637f25dec5e9e26cb838995072a495a552ba4e4eecf75
turbo-cache-controlno-preview
go-importgithub.com/python/typeshed git https://github.com/python/typeshed.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id31696383
octolytics-dimension-repository_nwopython/typeshed
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id31696383
octolytics-dimension-repository_network_root_nwopython/typeshed
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
release0e75efa5f34074f831bc22b1a793c40d20fa144b
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/typeshed/issues/8988#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftypeshed%2Fissues%2F8988
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftypeshed%2Fissues%2F8988
Sign uphttps://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=python%2Ftypeshed
Reloadhttps://github.com/python/typeshed/issues/8988
Reloadhttps://github.com/python/typeshed/issues/8988
Reloadhttps://github.com/python/typeshed/issues/8988
pythonhttps://github.com/python
typeshedhttps://github.com/python/typeshed
Codehttps://github.com/python/typeshed
Issues196 (196)https://github.com/python/typeshed/issues
Pull requests249 (249)https://github.com/python/typeshed/pulls
Actionshttps://github.com/python/typeshed/actions
Security and qualityhttps://github.com/python/typeshed/security
Insightshttps://github.com/python/typeshed/insights
https://github.com/python/typeshed
New issuehttps://github.com/login?return_to=https://github.com/python/typeshed/issues/8988
New issuehttps://github.com/login?return_to=https://github.com/python/typeshed/issues/8988
Should stubs contain default values?https://github.com/python/typeshed/issues/8988#top
project: policyOrganization of the typeshed projecthttps://github.com/python/typeshed/issues?q=state%3Aopen%20label%3A%22project%3A%20policy%22
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
on Oct 26, 2022https://github.com/python/typeshed/issues/8988#issue-1423314488
#4881https://github.com/python/typeshed/issues/4881
@gramsterhttps://github.com/gramster
Nexthttps://github.com/python/typeshed/issues/8988?timeline_page=1
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
on Oct 26, 2022https://github.com/python/typeshed/issues/8988#issuecomment-1291390800
srittauhttps://github.com/srittau
project: policyOrganization of the typeshed projecthttps://github.com/python/typeshed/issues?q=state%3Aopen%20label%3A%22project%3A%20policy%22
on Oct 26, 2022https://github.com/python/typeshed/issues/8988#event-7669889574
https://github.com/srittau
srittauhttps://github.com/srittau
on Oct 26, 2022https://github.com/python/typeshed/issues/8988#issuecomment-1291596273
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
on Oct 27, 2022https://github.com/python/typeshed/issues/8988#issuecomment-1293286069
https://github.com/sobolevn
sobolevnhttps://github.com/sobolevn
on Oct 27, 2022https://github.com/python/typeshed/issues/8988#issuecomment-1293619614
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
on Oct 27, 2022https://github.com/python/typeshed/issues/8988#issuecomment-1293623153
@hauntsaninjahttps://github.com/hauntsaninja
https://github.com/srittau
srittauhttps://github.com/srittau
on Oct 27, 2022https://github.com/python/typeshed/issues/8988#issuecomment-1293641651
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
on Oct 27, 2022https://github.com/python/typeshed/issues/8988#issuecomment-1293699325
https://github.com/gramster
gramsterhttps://github.com/gramster
on Oct 27, 2022https://github.com/python/typeshed/issues/8988#issuecomment-1293787509
…https://github.com/python/typeshed/issues/8988
#8988 (comment)https://github.com/python/typeshed/issues/8988#issuecomment-1293699325
https://github.com/notifications/unsubscribe-auth/AAVCPCAEIXNELUUVHAVZ2WLWFKM47ANCNFSM6AAAAAAROQJKTUhttps://github.com/notifications/unsubscribe-auth/AAVCPCAEIXNELUUVHAVZ2WLWFKM47ANCNFSM6AAAAAAROQJKTU
https://github.com/jpe
jpehttps://github.com/jpe
on Oct 27, 2022https://github.com/python/typeshed/issues/8988#issuecomment-1293799673
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
on Oct 27, 2022https://github.com/python/typeshed/issues/8988#issuecomment-1293801129
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
on Oct 27, 2022https://github.com/python/typeshed/issues/8988#issuecomment-1293801443
Should stubs contain docstrings? #4881https://github.com/python/typeshed/issues/4881
https://github.com/jpe
jpehttps://github.com/jpe
on Oct 27, 2022https://github.com/python/typeshed/issues/8988#issuecomment-1293834496
https://github.com/Avasam
Avasamhttps://github.com/Avasam
on Nov 2, 2022https://github.com/python/typeshed/issues/8988#issuecomment-1299535266
#7258https://github.com/python/typeshed/issues/7258
#4881 (comment)https://github.com/python/typeshed/issues/4881#issuecomment-1275465471
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
on Nov 12, 2022https://github.com/python/typeshed/issues/8988#issuecomment-1312377043
https://github.com/JelleZijlstra/stubdefaulterhttps://github.com/JelleZijlstra/stubdefaulter
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
on Jan 20, 2023https://github.com/python/typeshed/issues/8988#issuecomment-1398366699
#9501https://github.com/python/typeshed/pull/9501
sys.maxsizehttps://docs.python.org/3/library/sys.html#sys.maxsize
typeshed/stdlib/collections/__init__.pyihttps://github.com/python/typeshed/blob/7e40d70cad61d81a4db815911caa95440dae85f5/stdlib/collections/__init__.pyi#L166
7e40d70https://github.com/python/typeshed/commit/7e40d70cad61d81a4db815911caa95440dae85f5
https://github.com/python/cpython/blob/3847a6c64b96bb2cb93be394a590d4df2c35e876/Lib/collections/__init__.py#L1439https://github.com/python/cpython/blob/3847a6c64b96bb2cb93be394a590d4df2c35e876/Lib/collections/__init__.py#L1439
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
on Jan 20, 2023https://github.com/python/typeshed/issues/8988#issuecomment-1398374253
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
on Jan 20, 2023https://github.com/python/typeshed/issues/8988#issuecomment-1398419039
@gramsterhttps://github.com/gramster
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
on Jan 20, 2023https://github.com/python/typeshed/issues/8988#issuecomment-1398423335
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
on Jan 20, 2023https://github.com/python/typeshed/issues/8988#issuecomment-1398510202
typeshed/stdlib/multiprocessing/heap.pyihttps://github.com/python/typeshed/blob/7e40d70cad61d81a4db815911caa95440dae85f5/stdlib/multiprocessing/heap.pyi#L30
7e40d70https://github.com/python/typeshed/commit/7e40d70cad61d81a4db815911caa95440dae85f5
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
on Jan 20, 2023https://github.com/python/typeshed/issues/8988#issuecomment-1398554016
typeshed/stdlib/platform.pyihttps://github.com/python/typeshed/blob/7e40d70cad61d81a4db815911caa95440dae85f5/stdlib/platform.pyi#L41
7e40d70https://github.com/python/typeshed/commit/7e40d70cad61d81a4db815911caa95440dae85f5
typeshed/stdlib/pydoc.pyihttps://github.com/python/typeshed/blob/7e40d70cad61d81a4db815911caa95440dae85f5/stdlib/pydoc.pyi#L61
7e40d70https://github.com/python/typeshed/commit/7e40d70cad61d81a4db815911caa95440dae85f5
https://github.com/python/cpython/blob/3847a6c64b96bb2cb93be394a590d4df2c35e876/Lib/pydoc.py#L495https://github.com/python/cpython/blob/3847a6c64b96bb2cb93be394a590d4df2c35e876/Lib/pydoc.py#L495
https://github.com/Avasam
Avasamhttps://github.com/Avasam
on Jan 23, 2023https://github.com/python/typeshed/issues/8988#issuecomment-1400762041
AlexWaygoodhttps://github.com/AlexWaygood
on Jan 29, 2023https://github.com/python/typeshed/issues/8988#event-8380837307
Add more defaults to the stdlib (#9606)https://github.com/python/typeshed/commit/33a62ae42d7a3a503d75013efed06e954415b48f
#9606https://github.com/python/typeshed/pull/9606
33a62aehttps://github.com/python/typeshed/commit/33a62ae42d7a3a503d75013efed06e954415b48f
Avasamhttps://github.com/Avasam
on Feb 1, 2023https://github.com/python/typeshed/issues/8988#event-8412412184
Add more defaults to the stdlib (python#9606)https://github.com/Avasam/typeshed/commit/619098ef27fb2204e645d17daadf1c410ad68587
python#9606https://github.com/python/typeshed/pull/9606
619098ehttps://github.com/Avasam/typeshed/commit/619098ef27fb2204e645d17daadf1c410ad68587
https://github.com/Avasam
Avasamhttps://github.com/Avasam
on May 2, 2023https://github.com/python/typeshed/issues/8988#issuecomment-1530849959
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
on May 2, 2023https://github.com/python/typeshed/issues/8988#issuecomment-1530853277
JelleZijlstrahttps://github.com/JelleZijlstra
completedhttps://github.com/python/typeshed/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on May 2, 2023https://github.com/python/typeshed/issues/8988#event-9141595621
https://github.com/Avasam
Avasamhttps://github.com/Avasam
on May 2, 2023https://github.com/python/typeshed/issues/8988#issuecomment-1530854767
#10127https://github.com/python/typeshed/pull/10127
hamdanalhttps://github.com/hamdanal
on Jun 2, 2023https://github.com/python/typeshed/issues/8988#event-9417362566
stubgen: Preserve simple defaults in function signatureshttps://github.com/hamdanal/mypy/commit/4692138eb83e73e5bcc68ba773ad4309bc363689
4692138https://github.com/hamdanal/mypy/commit/4692138eb83e73e5bcc68ba773ad4309bc363689
JelleZijlstrahttps://github.com/JelleZijlstra
on Nov 27, 2023https://github.com/python/typeshed/issues/8988#event-11064872346
stubgen: Preserve simple defaults in function signatures (#15355)https://github.com/python/mypy/commit/e69c5cde8643e04a54a644cc27814ab98181541d
#15355https://github.com/python/mypy/pull/15355
e69c5cdhttps://github.com/python/mypy/commit/e69c5cde8643e04a54a644cc27814ab98181541d
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/typeshed/issues/8988
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/typeshed/issues/8988
project: policyOrganization of the typeshed projecthttps://github.com/python/typeshed/issues?q=state%3Aopen%20label%3A%22project%3A%20policy%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.