Title: Decide what to do with numbers.Integral etc. · Issue #272 · python/typing · GitHub
Open Graph Title: Decide what to do with numbers.Integral etc. · Issue #272 · python/typing
X Title: Decide what to do with numbers.Integral etc. · Issue #272 · python/typing
Description: It's not clear what's the best way to deal with numbers.Integral, numbers.Real, etc. Various issues are discussed in python/typeshed#464. Some relevant questions: Should int be a subclass of Integral (and similarly for float / Real)? If ...
Open Graph Description: It's not clear what's the best way to deal with numbers.Integral, numbers.Real, etc. Various issues are discussed in python/typeshed#464. Some relevant questions: Should int be a subclass of Integr...
X Description: It's not clear what's the best way to deal with numbers.Integral, numbers.Real, etc. Various issues are discussed in python/typeshed#464. Some relevant questions: Should int be a subclass o...
Opengraph URL: https://github.com/python/typing/issues/272
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Decide what to do with numbers.Integral etc.","articleBody":"It's not clear what's the best way to deal with `numbers.Integral`, `numbers.Real`, etc. Various issues are discussed in https://github.com/python/typeshed/pull/464.\n\nSome relevant questions:\n1. Should `int` be a subclass of `Integral` (and similarly for `float` / `Real`)? If yes, how should we annotate the stubs? (Let's focus on `__add__` and `__radd__` -- other operators are probably similar.)\n2. Should stubs prefer `Integral` and `Real` to `int` and `float` whenever feasible? Many stdlib functions only accept concrete `int` or `float` instances, so using them everywhere wouldn't be safe.\n3. Should we recommend user code to use `int` or `Integral` by default? If we don't have a consistent convention, integrating codebases that use different conventions could become painful, as `Integral` should almost certainly not be a subtype of `int`.\n4. Can we find examples of some typical use cases where just using `int` / `float` is not sufficient and `Integral` / `Real` could help? How common and important are these use cases?\n5. If (1) is blocked by limitations of the type system, should we look at extending to the type system to better support abstract numeric types? What are the current limitations?\n6. If (1) or (2) requires compromising some type safety, are the gains important enough to make this a worthwhile tradeoff?\n","author":{"url":"https://github.com/JukkaL","@type":"Person","name":"JukkaL"},"datePublished":"2016-08-29T16:52:30Z","url":"https://github.com/python/typing/issues/272"}
| 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:3940baae-3732-5661-97e8-0fce8e233c27 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AB64:1EF2:C0E1AE:10B3080:6B003559 |
| html-safe-nonce | 518b16cefbf0e2d915e11b12647a697a7ac5caf4df2cd930bdd19140755ab41b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQjY0OjFFRjI6QzBFMUFFOjEwQjMwODA6NkIwMDM1NTkiLCJ2aXNpdG9yX2lkIjoiMTcyMTM5NzMxNzUwMTcyODA4OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d4aa903341501036978b3fea27809567859ee4658e52b2e8443277cbd87bc009 |
| hovercard-subject-tag | issue:173819589 |
| 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/272/issue_layout |
| twitter:image | https://opengraph.githubassets.com/522a698a3571ac5ab7b9a59769e33f87c5a058f2f6f6e66cc4ab41eaf6d48bea/python/typing/issues/272 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/522a698a3571ac5ab7b9a59769e33f87c5a058f2f6f6e66cc4ab41eaf6d48bea/python/typing/issues/272 |
| og:image:alt | It's not clear what's the best way to deal with numbers.Integral, numbers.Real, etc. Various issues are discussed in python/typeshed#464. Some relevant questions: Should int be a subclass of Integr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JukkaL |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| 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 | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width