Title: python <3.8: math functions shouldn't accept any object with __index__ method · Issue #6213 · python/typeshed · GitHub
Open Graph Title: python <3.8: math functions shouldn't accept any object with __index__ method · Issue #6213 · python/typeshed
X Title: python <3.8: math functions shouldn't accept any object with __index__ method · Issue #6213 · python/typeshed
Description: Runtime: akuli@akuli-desktop:/tmp$ cat asd.py class Foo: def __index__(self): return 1 akuli@akuli-desktop:/tmp$ python3.7 -c 'import math, asd; math.sin(asd.Foo())' Traceback (most recent call last): File "
Open Graph Description: Runtime: akuli@akuli-desktop:/tmp$ cat asd.py class Foo: def __index__(self): return 1 akuli@akuli-desktop:/tmp$ python3.7 -c 'import math, asd; math.sin(asd.Foo())' Traceback (most recent call las...
X Description: Runtime: akuli@akuli-desktop:/tmp$ cat asd.py class Foo: def __index__(self): return 1 akuli@akuli-desktop:/tmp$ python3.7 -c 'import math, asd; math.sin(asd.Foo())' Traceback (most recent ...
Opengraph URL: https://github.com/python/typeshed/issues/6213
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"python \u003c3.8: math functions shouldn't accept any object with __index__ method","articleBody":"Runtime:\r\n\r\n```\r\nakuli@akuli-desktop:/tmp$ cat asd.py\r\nclass Foo:\r\n def __index__(self):\r\n return 1\r\nakuli@akuli-desktop:/tmp$ python3.7 -c 'import math, asd; math.sin(asd.Foo())'\r\nTraceback (most recent call last):\r\n File \"\u003cstring>\", line 1, in \u003cmodule>\r\nTypeError: must be real number, not Foo\r\nakuli@akuli-desktop:/tmp$ python3.8 -c 'import math, asd; math.sin(asd.Foo())'\r\nakuli@akuli-desktop:/tmp$ \r\n```\r\n\r\nStub:\r\n\r\nhttps://github.com/python/typeshed/blob/05cc30b8da576f882dff41ae31c281c859b65f98/stdlib/math.pyi#L6\r\n\r\nhttps://github.com/python/typeshed/blob/05cc30b8da576f882dff41ae31c281c859b65f98/stdlib/math.pyi#L102","author":{"url":"https://github.com/Akuli","@type":"Person","name":"Akuli"},"datePublished":"2021-10-30T11:00:27Z","url":"https://github.com/python/typeshed/issues/6213"}
| 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:15795412-31a1-e9a8-ba1f-26c49a58ad03 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EC90:1F5A:8AE2B:11553E:6B002BF3 |
| html-safe-nonce | 43108de0327c6806aea57649d2ef4ec77b2af4744b68e6f8b4fce380fdf2addf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQzkwOjFGNUE6OEFFMkI6MTE1NTNFOjZCMDAyQkYzIiwidmlzaXRvcl9pZCI6IjU5NjI3ODg1NTU3OTYyNjE4NzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f5ab269963f3eed977b2c554737652b2ae53af6f9d574feca837e30f3ec5d23f |
| hovercard-subject-tag | issue:1040117069 |
| 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/6213/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e25d67706c0e4b01be2a672a6ee598a6f92e6590ab8f6eddba7d71f51ce090fd/python/typeshed/issues/6213 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e25d67706c0e4b01be2a672a6ee598a6f92e6590ab8f6eddba7d71f51ce090fd/python/typeshed/issues/6213 |
| og:image:alt | Runtime: akuli@akuli-desktop:/tmp$ cat asd.py class Foo: def __index__(self): return 1 akuli@akuli-desktop:/tmp$ python3.7 -c 'import math, asd; math.sin(asd.Foo())' Traceback (most recent call las... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Akuli |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| 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 | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width