Title: math.prod typing incorrect · Issue #11913 · python/typeshed · GitHub
Open Graph Title: math.prod typing incorrect · Issue #11913 · python/typeshed
X Title: math.prod typing incorrect · Issue #11913 · python/typeshed
Description: Test file (decimal_prod.py): from decimal import Decimal from math import prod from typing import TYPE_CHECKING result = prod([Decimal(1), Decimal(2)]) if TYPE_CHECKING: reveal_type(result) else: print(type(result)) Test: $ mypy --versio...
Open Graph Description: Test file (decimal_prod.py): from decimal import Decimal from math import prod from typing import TYPE_CHECKING result = prod([Decimal(1), Decimal(2)]) if TYPE_CHECKING: reveal_type(result) else: p...
X Description: Test file (decimal_prod.py): from decimal import Decimal from math import prod from typing import TYPE_CHECKING result = prod([Decimal(1), Decimal(2)]) if TYPE_CHECKING: reveal_type(result) else: p...
Opengraph URL: https://github.com/python/typeshed/issues/11913
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"math.prod typing incorrect","articleBody":"Test file (`decimal_prod.py`):\r\n```\r\nfrom decimal import Decimal\r\nfrom math import prod\r\nfrom typing import TYPE_CHECKING\r\n\r\nresult = prod([Decimal(1), Decimal(2)])\r\n\r\nif TYPE_CHECKING:\r\n reveal_type(result)\r\nelse:\r\n print(type(result))\r\n```\r\n\r\nTest:\r\n```\r\n$ mypy --version\r\nmypy 1.10.0 (compiled: yes)\r\n$ mypy decimal_prod.py\r\ndecimal_prod.py:8: note: Revealed type is \"builtins.float\"\r\nSuccess: no issues found in 1 source file\r\n$ python decimal_prod.py\r\n\u003cclass 'decimal.Decimal'>\r\n```\r\n\r\ndefined here: https://github.com/python/typeshed/blob/main/stdlib/math.pyi#L102-L105","author":{"url":"https://github.com/karolinepauls","@type":"Person","name":"karolinepauls"},"datePublished":"2024-05-13T15:18:20Z","url":"https://github.com/python/typeshed/issues/11913"}
| 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:c41f3a57-f34e-df88-6a29-0991bbc61be6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ECBA:1F75:282152:3C4DD0:6B0044D5 |
| html-safe-nonce | 4a200607299b1d69408b111a272c4133ccee94c388d2c6a8d3b03a77776b9925 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQ0JBOjFGNzU6MjgyMTUyOjNDNEREMDo2QjAwNDRENSIsInZpc2l0b3JfaWQiOiI2MTAwOTAxMjU2NDkzMDI0NDY5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 3ecfe6b6f0ab63b1e4567434a82dc1bf8fcffe0cd7404b15b5fb41ccf3e49b32 |
| hovercard-subject-tag | issue:2293126920 |
| 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/11913/issue_layout |
| twitter:image | https://opengraph.githubassets.com/84c7ca09283a7e91cc17169a29ccb530cee000fbc60410f523c0dca5235add85/python/typeshed/issues/11913 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/84c7ca09283a7e91cc17169a29ccb530cee000fbc60410f523c0dca5235add85/python/typeshed/issues/11913 |
| og:image:alt | Test file (decimal_prod.py): from decimal import Decimal from math import prod from typing import TYPE_CHECKING result = prod([Decimal(1), Decimal(2)]) if TYPE_CHECKING: reveal_type(result) else: p... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | karolinepauls |
| 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