Title: Allow Ellipsis as annotation for inferred type · Issue #276 · python/typing · GitHub
Open Graph Title: Allow Ellipsis as annotation for inferred type · Issue #276 · python/typing
X Title: Allow Ellipsis as annotation for inferred type · Issue #276 · python/typing
Description: PEP 484 says that if an annotation is missing then the type assumed to be Any def f(x) -> None: reveal_type(x) # Revealed type is 'Any' def g(x: int): pass reveal_type(g(1)) # Revealed type is 'Any' However, it is not clear how to say to...
Open Graph Description: PEP 484 says that if an annotation is missing then the type assumed to be Any def f(x) -> None: reveal_type(x) # Revealed type is 'Any' def g(x: int): pass reveal_type(g(1)) # Revealed type is 'Any...
X Description: PEP 484 says that if an annotation is missing then the type assumed to be Any def f(x) -> None: reveal_type(x) # Revealed type is 'Any' def g(x: int): pass reveal_type(g(1)) # Revealed t...
Opengraph URL: https://github.com/python/typing/issues/276
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Allow Ellipsis as annotation for inferred type","articleBody":"PEP 484 says that if an annotation is missing then the type assumed to be `Any`\r\n\r\n``` python\r\ndef f(x) -> None:\r\n reveal_type(x) # Revealed type is 'Any'\r\ndef g(x: int):\r\n pass\r\nreveal_type(g(1)) # Revealed type is 'Any'\r\n```\r\n\r\nHowever, it is not clear how to say to type checker that it should infer a missing type, rather than assume that it is `Any`. It was proposed by @ncoghlan to use Ellipsis for this purpose:\r\n\r\n``` python\r\ndef f(x: ...) -> None:\r\n ...\r\ndef g(x: int) -> ...:\r\n ...\r\n```\r\n\r\nI am opening this issue, so that this idea will not be forgotten.\r\n","author":{"url":"https://github.com/ilevkivskyi","@type":"Person","name":"ilevkivskyi"},"datePublished":"2016-09-03T19:36:33Z","url":"https://github.com/python/typing/issues/276"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:21f1e247-c767-7acd-a17b-b1c983e5a0d7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C988:3AC034:3609E4:496410:6B0028EA |
| html-safe-nonce | b5ee633f5a840537669c4d19fac8ed9d6ca6945eefa1a47a4a7615a995a4d9ec |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTg4OjNBQzAzNDozNjA5RTQ6NDk2NDEwOjZCMDAyOEVBIiwidmlzaXRvcl9pZCI6IjUwNTI2MDY4OTAzODM1MTc5MzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7c7adcbe1580bac22698df2abd43b8c6d335d78ae655074746f3de1625530791 |
| hovercard-subject-tag | issue:174913551 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/typing/276/issue_layout |
| twitter:image | https://opengraph.githubassets.com/52fca2cbaef194cf38a80b0456c50baad60acf50955713766403841cb8eb801e/python/typing/issues/276 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/52fca2cbaef194cf38a80b0456c50baad60acf50955713766403841cb8eb801e/python/typing/issues/276 |
| og:image:alt | PEP 484 says that if an annotation is missing then the type assumed to be Any def f(x) -> None: reveal_type(x) # Revealed type is 'Any' def g(x: int): pass reveal_type(g(1)) # Revealed type is 'Any... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ilevkivskyi |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typing git https://github.com/python/typing.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 24604008 |
| octolytics-dimension-repository_nwo | python/typing |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24604008 |
| octolytics-dimension-repository_network_root_nwo | python/typing |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 44c658b24abf00491fb7ae5f56d42c9f38cbeab2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width