René's URL Explorer Experiment


Title: Proposal: signature copying for kwargs. · Issue #270 · python/typing · GitHub

Open Graph Title: Proposal: signature copying for kwargs. · Issue #270 · python/typing

X Title: Proposal: signature copying for kwargs. · Issue #270 · python/typing

Description: There's a quite common pattern in python code which is: def function(foo, *args, **kwargs): # do something with foo other_function(*args, **kwargs) # possibly do something else def other_function(color: str=..., temperature: float=..., s...

Open Graph Description: There's a quite common pattern in python code which is: def function(foo, *args, **kwargs): # do something with foo other_function(*args, **kwargs) # possibly do something else def other_function(c...

X Description: There's a quite common pattern in python code which is: def function(foo, *args, **kwargs): # do something with foo other_function(*args, **kwargs) # possibly do something else def other_functi...

Opengraph URL: https://github.com/python/typing/issues/270

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Proposal: signature copying for kwargs.","articleBody":"There's a quite common pattern in python code which is:\n\n``` python\ndef function(foo, *args, **kwargs):\n    # do something with foo\n    other_function(*args, **kwargs)\n    # possibly do something else\n\ndef other_function(color: str=..., temperature: float=..., style: Stylesheet=..., timeout: Optional[int]=..., database_adaptor: Adaptor=..., strict: bool=..., output: IO[str], allow_frogs: bool=..., mode: SomeEnum=...):\n    # do something with a lot of options\n```\n\n(a usual subcase of this one is when `other_function` is actually `super().function` ). This presents two problems for a static analyzer:\n- the call from `function` to `other_function` can not be type-checked properly because of the `*args, **kwargs` in the call arguments.\n- there is no sensible way to annotate `function`, so calls to it are unchecked.\n\nThe problem for me also affects readability of the code (which is for me one of the main problems that annotations tries to address). James Powell from numfocus even gave a pydata talk about the difficulties it brings at https://www.youtube.com/watch?v=MQMbnhSthZQ\n\nEven if theoretically the args/kwargs packing feature of python can be used with more or less arbitrary data, IMO this use-case is common enough to warrant some special treatment. I was thinking on a way to flag this usage, for example:\n\n```\n@delegate_args(other_function)\ndef function(foo, *args, **kwargs):\n    other_function(*args, **kwargs)\n```\n\nThis could hint an analyzer so:\n- On calls to `function`, the \"extra\" arguments are checked to match the signature of `other_function`\n- The call to other_function is considered valid given that it uses the same arguments (I know that the code above could have modified the content of kwargs, but it's still more checking than what we have now).\n\nFor me, even without static analyzer, the readability benefits of seeing\n\n```\n@delegate_args(matplotlib.pyplot.plot)\ndef plot_valuation(ticker_symbol: str, start: date, end: date, *args, **kwargs): ...\n```\n\nand knowing that `plot_valuation` accepts any valid arguments from matplotlib's plot function, is worth it.\n","author":{"url":"https://github.com/dmoisset","@type":"Person","name":"dmoisset"},"datePublished":"2016-08-26T16:55:21Z","url":"https://github.com/python/typing/issues/270"}

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:3b4087ee-3e02-89c2-5da4-fcea9e5bbad1
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBD5E:1DA187:29B0A07:36A1BD7:6B000A11
html-safe-nonce36eb78ad49cb4a90012f1a980f862d22c2664f174b8a49028d4511aa8bc7477f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRDVFOjFEQTE4NzoyOUIwQTA3OjM2QTFCRDc6NkIwMDBBMTEiLCJ2aXNpdG9yX2lkIjoiNzI5NTEyMTUwNDQ2NTg0ODg0OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac3a58c879984dbf783ed8950118bed6d8acb8a1dcfaf03f0aebd74324ac1d13d2
hovercard-subject-tagissue:173497307
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/typing/270/issue_layout
twitter:imagehttps://opengraph.githubassets.com/61d2dbd5d3f83a2bc96425929d428a377a399cf7b9010dbbd30e8ee4dad7e0af/python/typing/issues/270
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/61d2dbd5d3f83a2bc96425929d428a377a399cf7b9010dbbd30e8ee4dad7e0af/python/typing/issues/270
og:image:altThere's a quite common pattern in python code which is: def function(foo, *args, **kwargs): # do something with foo other_function(*args, **kwargs) # possibly do something else def other_function(c...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedmoisset
hostnamegithub.com
expected-hostnamegithub.com
None0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729
turbo-cache-controlno-preview
go-importgithub.com/python/typing git https://github.com/python/typing.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id24604008
octolytics-dimension-repository_nwopython/typing
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24604008
octolytics-dimension-repository_network_root_nwopython/typing
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
release16a11879678aaf97e2a42c33ee70830aa084fa37
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/typing/issues/270#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftyping%2Fissues%2F270
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%2Ftyping%2Fissues%2F270
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%2Ftyping
Reloadhttps://github.com/python/typing/issues/270
Reloadhttps://github.com/python/typing/issues/270
Reloadhttps://github.com/python/typing/issues/270
pythonhttps://github.com/python
typinghttps://github.com/python/typing
Codehttps://github.com/python/typing
Issues206 (206)https://github.com/python/typing/issues
Pull requests27 (27)https://github.com/python/typing/pulls
Discussionshttps://github.com/python/typing/discussions
Actionshttps://github.com/python/typing/actions
Security and qualityhttps://github.com/python/typing/security
Insightshttps://github.com/python/typing/insights
https://github.com/python/typing
New issuehttps://github.com/login?return_to=https://github.com/python/typing/issues/270
New issuehttps://github.com/login?return_to=https://github.com/python/typing/issues/270
Proposal: signature copying for kwargs.https://github.com/python/typing/issues/270#top
https://github.com/dmoisset
dmoissethttps://github.com/dmoisset
on Aug 26, 2016https://github.com/python/typing/issues/270#issue-173497307
https://www.youtube.com/watch?v=MQMbnhSthZQhttps://www.youtube.com/watch?v=MQMbnhSthZQ
Nexthttps://github.com/python/typing/issues/270?timeline_page=1
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on Aug 26, 2016https://github.com/python/typing/issues/270#issuecomment-242800710
https://github.com/JukkaL
JukkaLhttps://github.com/JukkaL
on Aug 26, 2016https://github.com/python/typing/issues/270#issuecomment-242821137
https://github.com/dmoisset
dmoissethttps://github.com/dmoisset
on Aug 31, 2016https://github.com/python/typing/issues/270#issuecomment-243832240
@JukkaLhttps://github.com/JukkaL
@JukkaLhttps://github.com/JukkaL
https://github.com/JukkaL
JukkaLhttps://github.com/JukkaL
on Aug 31, 2016https://github.com/python/typing/issues/270#issuecomment-243834548
@dmoissethttps://github.com/dmoisset
https://github.com/dfee
dfeehttps://github.com/dfee
on Jun 13, 2018https://github.com/python/typing/issues/270#issuecomment-397043605
forgehttps://github.com/dfee/forge
https://github.com/alexmojaki
alexmojakihttps://github.com/alexmojaki
on Jun 13, 2018https://github.com/python/typing/issues/270#issuecomment-397048884
https://github.com/dfee
dfeehttps://github.com/dfee
on Jun 13, 2018https://github.com/python/typing/issues/270#issuecomment-397053760
in the docshttps://python-forge.readthedocs.io/en/latest/signature.html#callwith
https://github.com/alexmojaki
alexmojakihttps://github.com/alexmojaki
on Jun 13, 2018https://github.com/python/typing/issues/270#issuecomment-397058335
https://github.com/dfee
dfeehttps://github.com/dfee
on Jun 13, 2018https://github.com/python/typing/issues/270#issuecomment-397110291
https://github.com/dfee
dfeehttps://github.com/dfee
on Jun 14, 2018https://github.com/python/typing/issues/270#issuecomment-397132553
alexmojakihttps://github.com/alexmojaki
on Sep 2, 2018https://github.com/python/typing/issues/270#event-1822259515
Add basics of delegate decorator: see python/typing#270https://github.com/alexmojaki/mypy/commit/2651fcb29d4fd37359f85caa8f5732e5dbc4c472
python/typing#270https://github.com/python/typing/issues/270
2651fcbhttps://github.com/alexmojaki/mypy/commit/2651fcb29d4fd37359f85caa8f5732e5dbc4c472
https://github.com/JukkaL
JukkaLhttps://github.com/JukkaL
on Sep 6, 2018https://github.com/python/typing/issues/270#issuecomment-419024849
python/mypy#5559https://github.com/python/mypy/pull/5559
@alexmojakihttps://github.com/alexmojaki
@ilevkivskyihttps://github.com/ilevkivskyi
python/mypy#5559https://github.com/python/mypy/pull/5559
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Sep 6, 2018https://github.com/python/typing/issues/270#issuecomment-419048523
Allow using TypedDict for more precise typing of **kwds mypy#4441https://github.com/python/mypy/issues/4441
https://github.com/dfee
dfeehttps://github.com/dfee
on Sep 7, 2018https://github.com/python/typing/issues/270#issuecomment-419325943
#270 (comment)https://github.com/python/typing/issues/270#issuecomment-242800710
https://github.com/alexmojaki
alexmojakihttps://github.com/alexmojaki
on Sep 17, 2018https://github.com/python/typing/issues/270#issuecomment-422176376
https://github.com/matthewgdv
matthewgdvhttps://github.com/matthewgdv
on Feb 16, 2021https://github.com/python/typing/issues/270#issuecomment-780187279
https://github.com/rmorshea
rmorsheahttps://github.com/rmorshea
on Feb 17, 2021https://github.com/python/typing/issues/270#issuecomment-780199738
@matthewgdvhttps://github.com/matthewgdv
#270 (comment)https://github.com/python/typing/issues/270#issuecomment-555966301
https://github.com/USSX-Hares
USSX-Hareshttps://github.com/USSX-Hares
on Jun 22, 2022https://github.com/python/typing/issues/270#issuecomment-1162998377
abovehttps://github.com/python/typing/issues/270#issuecomment-243832240
PEP-612https://peps.python.org/612
https://github.com/ahuang11
ahuang11https://github.com/ahuang11
on Oct 28, 2022https://github.com/python/typing/issues/270#issuecomment-1294260305
a previous commenthttps://github.com/python/typing/issues/270#issuecomment-242800710
https://user-images.githubusercontent.com/15331990/198421137-b69faa3b-47fa-4a97-9252-fe43e0cfab79.png
https://github.com/ringohoffman
ringohoffmanhttps://github.com/ringohoffman
on Nov 30, 2022https://github.com/python/typing/issues/270#issuecomment-1331767776
@ahuang11https://github.com/ahuang11
https://peps.python.org/pep-0612/#concatenating-keyword-parametershttps://peps.python.org/pep-0612/#concatenating-keyword-parameters
https://mypy.readthedocs.io/en/stable/protocols.html#callback-protocolshttps://mypy.readthedocs.io/en/stable/protocols.html#callback-protocols
https://github.com/Ige-fi
Ige-fihttps://github.com/Ige-fi
on Dec 9, 2022https://github.com/python/typing/issues/270#issuecomment-1344133766
https://github.com/matthewgdv
matthewgdvhttps://github.com/matthewgdv
on Dec 9, 2022https://github.com/python/typing/issues/270#issuecomment-1344387769
https://github.com/ringohoffman
ringohoffmanhttps://github.com/ringohoffman
on Dec 9, 2022https://github.com/python/typing/issues/270#issuecomment-1344537820
@matthewgdvhttps://github.com/matthewgdv
https://github.com/Ige-fi
Ige-fihttps://github.com/Ige-fi
on Dec 9, 2022https://github.com/python/typing/issues/270#issuecomment-1344775025
@matthewgdvhttps://github.com/matthewgdv
https://github.com/Ige-fi
Ige-fihttps://github.com/Ige-fi
on Dec 12, 2022https://github.com/python/typing/issues/270#issuecomment-1346124813
@ringohoffmanhttps://github.com/ringohoffman
https://github.com/Moortiii
Moortiiihttps://github.com/Moortiii
on May 10, 2023https://github.com/python/typing/issues/270#issuecomment-1541935319
https://github.com/rmorshea
rmorsheahttps://github.com/rmorshea
on May 10, 2023https://github.com/python/typing/issues/270#issuecomment-1542456348
@Moortiiihttps://github.com/Moortiii
https://github.com/Moortiii
Moortiiihttps://github.com/Moortiii
on May 10, 2023https://github.com/python/typing/issues/270#issuecomment-1542534445
Sentinel PEPhttps://peps.python.org/pep-0661/
https://github.com/rmorshea
rmorsheahttps://github.com/rmorshea
on May 10, 2023https://github.com/python/typing/issues/270#issuecomment-1542766082
keyword argument concatenationhttps://peps.python.org/pep-0612/#concatenating-keyword-parameters
https://github.com/jaens
jaenshttps://github.com/jaens
on May 3, 2025https://github.com/python/typing/issues/270#issuecomment-2848608778
python/cpython#121693https://github.com/python/cpython/pull/121693
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/typing/issues/270
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/typing/issues/270
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.