René's URL Explorer Experiment


Title: Is it possible to overload depending on the presence of an argument? · Issue #248 · python/typing · GitHub

Open Graph Title: Is it possible to overload depending on the presence of an argument? · Issue #248 · python/typing

X Title: Is it possible to overload depending on the presence of an argument? · Issue #248 · python/typing

Description: I'm not sure if this is an issue, a feature request, or a question... While trying to write typesheds for numpy I found this (simplified) situation: I have a method with the following signature T = TypeVar('T') def foo(self, arg1: int=.....

Open Graph Description: I'm not sure if this is an issue, a feature request, or a question... While trying to write typesheds for numpy I found this (simplified) situation: I have a method with the following signature T =...

X Description: I'm not sure if this is an issue, a feature request, or a question... While trying to write typesheds for numpy I found this (simplified) situation: I have a method with the following signature...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Is it possible to overload depending on the presence of an argument?","articleBody":"I'm not sure if this is an issue, a feature request, or a question...\n\nWhile trying to write typesheds for numpy I found this (simplified) situation:\n\nI have a method with the following signature\n\n``` python\nT = TypeVar('T')\ndef foo(self, arg1: int=..., arg2: int=..., *, out: T=None):\n```\n\nThe function returns a `bool` when the `out` argument is not present (so `foo()`, `foo(x, y)`, `foo(arg2=x)` all are boolean values).\n\nThe function returns a `T` when the `out` argument is present (so `foo(out=\"hello\")`, `foo(x, y, out=\"hello\")`, `foo(out=\"hello\", arg2=x)` all are string values).\n\nI was trying to describe that as an overload (and restricting to keyword only args to avoid mistakes):\n\n``` python\nfrom typing import TypeVar, overload\n\nT = TypeVar('T')\n\nclass C:\n    @overload\n    def foo(self, *, arg1: int=0, arg2: int=0) -> bool: ...\n    @overload\n    def foo(self, *, arg1: int=0, arg2: int=0, out:T=None) -> T: ...\n\nreveal_type(C().foo())\nreveal_type(C().foo(out=\"hello\"))\n```\n\nbut the revealed_type for the result of the first call is \"Any\". I don't think my definition should be ok (my overloaded signatures are ambiguous), but an Any there is certainly unexpected there. Also, I'm not sure what would be (if possible) the way to express this situation with mypy's type system\n","author":{"url":"https://github.com/dmoisset","@type":"Person","name":"dmoisset"},"datePublished":"2016-07-18T20:42:52Z","url":"https://github.com/python/typing/issues/248"}

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:a3f62762-38ab-1276-98db-cc9f4432cb45
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8A72:CF959:2AD6909:3822DD3:6B000A0C
html-safe-nonceca0c07f3ff9729a1dd4624e736699e5ef228ea3c6767541d6261dd3bf76931f4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QTcyOkNGOTU5OjJBRDY5MDk6MzgyMkREMzo2QjAwMEEwQyIsInZpc2l0b3JfaWQiOiI5MTU5NTc5MTQyODA1NTIyOTU2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac4e299df61f98f715cb7b228bca9f4f7b6c9f7b6e789dd5e50dd12e9635c2cc3d
hovercard-subject-tagissue:166188716
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/248/issue_layout
twitter:imagehttps://opengraph.githubassets.com/edbfc232c7bab18fef546ef06f42bff26888ce96cc9c3d98f1997945213259aa/python/typing/issues/248
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/edbfc232c7bab18fef546ef06f42bff26888ce96cc9c3d98f1997945213259aa/python/typing/issues/248
og:image:altI'm not sure if this is an issue, a feature request, or a question... While trying to write typesheds for numpy I found this (simplified) situation: I have a method with the following signature T =...
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/248#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftyping%2Fissues%2F248
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%2F248
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/248
Reloadhttps://github.com/python/typing/issues/248
Reloadhttps://github.com/python/typing/issues/248
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/248
New issuehttps://github.com/login?return_to=https://github.com/python/typing/issues/248
Is it possible to overload depending on the presence of an argument?https://github.com/python/typing/issues/248#top
https://github.com/dmoisset
dmoissethttps://github.com/dmoisset
on Jul 18, 2016https://github.com/python/typing/issues/248#issue-166188716
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on Jul 19, 2016https://github.com/python/typing/issues/248#issuecomment-233504681
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Jul 19, 2016https://github.com/python/typing/issues/248#issuecomment-233613070
@dmoissethttps://github.com/dmoisset
https://github.com/dmoisset
dmoissethttps://github.com/dmoisset
on Jul 19, 2016https://github.com/python/typing/issues/248#issuecomment-233633375
dmoissethttps://github.com/dmoisset
completedhttps://github.com/python/typing/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jul 19, 2016https://github.com/python/typing/issues/248#event-727533446
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/typing/issues/248
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/typing/issues/248
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.