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
Domain: github.com
{"@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-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:2de88525-a678-0984-cad1-573f8fa31255 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AFF6:163716:B8F633:F829BC:6AFFA7BC |
| html-safe-nonce | 71831e41e87cd73a1153d268319d71ba4ee25cc5e15c8d7b6b0927f47654cd3a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRkY2OjE2MzcxNjpCOEY2MzM6RjgyOUJDOjZBRkZBN0JDIiwidmlzaXRvcl9pZCI6IjIwMDg0NzY1Nzc5OTM1NjYxNDAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 70cb9b0940619e6f1688a99852ba35139bfbaa2571a4cca022470fe72535409e |
| hovercard-subject-tag | issue:1423314488 |
| 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/typeshed/8988/issue_layout |
| twitter:image | https://opengraph.githubassets.com/763ca4780ba7f561234fc5783f02923766a5d547c6bb173c93dec7df77617f06/python/typeshed/issues/8988 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/763ca4780ba7f561234fc5783f02923766a5d547c6bb173c93dec7df77617f06/python/typeshed/issues/8988 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hauntsaninja |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6a41d7f592f24f38b58637f25dec5e9e26cb838995072a495a552ba4e4eecf75 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typeshed git https://github.com/python/typeshed.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 31696383 |
| octolytics-dimension-repository_nwo | python/typeshed |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31696383 |
| octolytics-dimension-repository_network_root_nwo | python/typeshed |
| 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 | 0e75efa5f34074f831bc22b1a793c40d20fa144b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width