Title: python >=3.8: cmath functions should accept any object with __index__ · Issue #6214 · python/typeshed · GitHub
Open Graph Title: python >=3.8: cmath functions should accept any object with __index__ · Issue #6214 · python/typeshed
X Title: python >=3.8: cmath functions should accept any object with __index__ · Issue #6214 · 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 cmath, asd; cmath.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 cmath, asd; cmath.sin(asd.Foo())' Traceback (most recent call l...
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 cmath, asd; cmath.sin(asd.Foo())' Traceback (most recen...
Opengraph URL: https://github.com/python/typeshed/issues/6214
X: @github
Domain: github.com
Links:
Viewport: width=device-width
Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"python >=3.8: cmath functions should accept any object with __index__","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 cmath, asd; cmath.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 cmath, asd; cmath.sin(asd.Foo())'\r\nakuli@akuli-desktop:/tmp$ \r\n```\r\n\r\n(The error message is wrong, the functions also accept complex numbers)\r\n\r\nStub:\r\n\r\nhttps://github.com/python/typeshed/blob/05cc30b8da576f882dff41ae31c281c859b65f98/stdlib/cmath.pyi#L11\r\n\r\nhttps://github.com/python/typeshed/blob/05cc30b8da576f882dff41ae31c281c859b65f98/stdlib/cmath.pyi#L30","author":{"url":"https://github.com/Akuli","@type":"Person","name":"Akuli"},"datePublished":"2021-10-30T11:02:46Z","url":"https://github.com/python/typeshed/issues/6214"}
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:60f20410-a777-2ac9-a98e-2c70eab21bfe current-catalog-service-hash 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 request-id E5EC:1DA187:30E6BBF:40AC470:6B002BFB html-safe-nonce aaed0afaa3b2971c8c74b22d331a06f74607e17849038e6dc6dfe4fc242d633d visitor-payload eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNUVDOjFEQTE4NzozMEU2QkJGOjQwQUM0NzA6NkIwMDJCRkIiLCJ2aXNpdG9yX2lkIjoiMzc5NTA1NDI2MTU0OTY3MzQ2OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 visitor-hmac b007ac98284da24d0624ab6f01ccfb14444d7592756f497a6f32cd8c36982d8d hovercard-subject-tag issue:1040117477 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/6214/issue_layout twitter:image https://opengraph.githubassets.com/e25d67706c0e4b01be2a672a6ee598a6f92e6590ab8f6eddba7d71f51ce090fd/python/typeshed/issues/6214 twitter:card summary_large_image og:image https://opengraph.githubassets.com/e25d67706c0e4b01be2a672a6ee598a6f92e6590ab8f6eddba7d71f51ce090fd/python/typeshed/issues/6214 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 cmath, asd; cmath.sin(asd.Foo())' Traceback (most recent call l... 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
URLs of crawlers that visited me.