Title: as_integer_ratio docstring's · Issue #101825 · python/cpython · GitHub
Open Graph Title: as_integer_ratio docstring's · Issue #101825 · python/cpython
X Title: as_integer_ratio docstring's · Issue #101825 · python/cpython
Description: For builtin/stdlib types we have int: Return integer ratio. Return a pair of integers, whose ratio is exactly equal to the original int and with a positive denominator. Fraction: as_integer_ratio(self) Return the integer ratio as a tuple...
Open Graph Description: For builtin/stdlib types we have int: Return integer ratio. Return a pair of integers, whose ratio is exactly equal to the original int and with a positive denominator. Fraction: as_integer_ratio(s...
X Description: For builtin/stdlib types we have int: Return integer ratio. Return a pair of integers, whose ratio is exactly equal to the original int and with a positive denominator. Fraction: as_integer_ratio(s...
Opengraph URL: https://github.com/python/cpython/issues/101825
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"as_integer_ratio docstring's","articleBody":"For builtin/stdlib types we have\r\n\r\nint:\r\n```\r\n Return integer ratio.\r\n\r\n Return a pair of integers, whose ratio is exactly equal to the original int\r\n and with a positive denominator.\r\n```\r\nFraction:\r\n```\r\nas_integer_ratio(self)\r\n Return the integer ratio as a tuple.\r\n\r\n Return a tuple of two integers, whose ratio is equal to the\r\n Fraction and with a positive denominator.\r\n```\r\nfloat:\r\n```\r\n Return integer ratio.\r\n\r\n Return a pair of integers, whose ratio is exactly equal to the original float\r\n and with a positive denominator.\r\n```\r\nDecimal:\r\n```\r\n Return a pair of integers, whose ratio is exactly equal to the original\r\n Decimal and with a positive denominator. The ratio is in lowest terms.\r\n Raise OverflowError on infinities and a ValueError on NaNs.\r\n```\r\n\r\nAll methods actually return a pair, whose ratio is in lowest terms, but only the last docstring says this explicitly. Shouldn't other methods do same? (Taken from [this](https://github.com/python/cpython/pull/101780#issuecomment-1426699906).)\r\n\r\nEdit: Ditto for some sphinx docs, e.g. for the float.as_integer_ratio(): \"Return a pair of integers whose ratio is exactly equal to the original float and with a positive denominator. Raises OverflowError on infinities and a ValueError on NaNs.\"\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-101843\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/skirpichev","@type":"Person","name":"skirpichev"},"datePublished":"2023-02-11T11:28:01.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/101825/cpython/issues/101825"}
| 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:35b8daa3-0650-10a4-8447-16d4b8a04fea |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A4C4:31B257:7A8CED:A40FF3:69697935 |
| html-safe-nonce | 4cb4afa77fe3186b21c194cc59c893d2a34e285532c84f6e6bfc8fc4a2320311 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNEM0OjMxQjI1Nzo3QThDRUQ6QTQwRkYzOjY5Njk3OTM1IiwidmlzaXRvcl9pZCI6Ijk5MDIzODk2ODUyMDQ3Mjg4NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b8196428bbf320e70dbbebdf30f2a9d0097dae7dff573ebf1eb29cc89e11fb57 |
| hovercard-subject-tag | issue:1580797320 |
| 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/cpython/101825/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b7ae1a09f71e6ba6bd37c8df16667305214b7c44455c208e43990f6092db969d/python/cpython/issues/101825 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b7ae1a09f71e6ba6bd37c8df16667305214b7c44455c208e43990f6092db969d/python/cpython/issues/101825 |
| og:image:alt | For builtin/stdlib types we have int: Return integer ratio. Return a pair of integers, whose ratio is exactly equal to the original int and with a positive denominator. Fraction: as_integer_ratio(s... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | skirpichev |
| hostname | github.com |
| expected-hostname | github.com |
| None | c6f193beb8ff08443adc07685d75302ab8aaf0a135f6e251c3ff3112c8deb881 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| 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 | 212e3e3d3298bf5b313830edfd2399e869f7ea76 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width