Title: `@overload` decorator on compiled functions is not tested · Issue #96478 · python/cpython · GitHub
Open Graph Title: `@overload` decorator on compiled functions is not tested · Issue #96478 · python/cpython
X Title: `@overload` decorator on compiled functions is not tested · Issue #96478 · python/cpython
Description: If I change this line cpython/Lib/typing.py Line 2584 in a91f255 pass to be try: _overload_registry[f.__module__][f.__qualname__][f.__code__.co_firstlineno] = func except AttributeError: # Not a normal function; ignore. raise # pass test...
Open Graph Description: If I change this line cpython/Lib/typing.py Line 2584 in a91f255 pass to be try: _overload_registry[f.__module__][f.__qualname__][f.__code__.co_firstlineno] = func except AttributeError: # Not a no...
X Description: If I change this line cpython/Lib/typing.py Line 2584 in a91f255 pass to be try: _overload_registry[f.__module__][f.__qualname__][f.__code__.co_firstlineno] = func except AttributeError: # Not a no...
Opengraph URL: https://github.com/python/cpython/issues/96478
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`@overload` decorator on compiled functions is not tested","articleBody":"If I change this line https://github.com/python/cpython/blob/a91f25577c71ab8797a4b42f22c43bbaffc2604d/Lib/typing.py#L2584\r\n\r\nto be\r\n\r\n```python\r\n try:\r\n _overload_registry[f.__module__][f.__qualname__][f.__code__.co_firstlineno] = func\r\n except AttributeError:\r\n # Not a normal function; ignore.\r\n raise # pass\r\n```\r\n\r\n`test_typing` continues to pass as expected. I think it is dangerous, because we can accidentally break something and not notice.\r\n\r\nI will send a simple test case to catch this: we should not fail.","author":{"url":"https://github.com/sobolevn","@type":"Person","name":"sobolevn"},"datePublished":"2022-09-01T13:58:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/96478/cpython/issues/96478"}
| 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:1953439e-97da-51a6-3de3-b8541d98fb14 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9256:EF6F3:314C7EE:406C97C:696B8965 |
| html-safe-nonce | 252d892a92e7480106e409490372a86562667f85cc66b61e7f6c3105be806d41 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MjU2OkVGNkYzOjMxNEM3RUU6NDA2Qzk3Qzo2OTZCODk2NSIsInZpc2l0b3JfaWQiOiIyODM2MzAwMzI5OTIzNjEwOTgxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 9cf78f03fc7e689d5b5980ac55a4959bbcd5f1101c58917974c232c24936f470 |
| hovercard-subject-tag | issue:1358895474 |
| 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/96478/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a8b200ce626bbebe231eb0054a137ab86438b21305adc1e3225582697380d319/python/cpython/issues/96478 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a8b200ce626bbebe231eb0054a137ab86438b21305adc1e3225582697380d319/python/cpython/issues/96478 |
| og:image:alt | If I change this line cpython/Lib/typing.py Line 2584 in a91f255 pass to be try: _overload_registry[f.__module__][f.__qualname__][f.__code__.co_firstlineno] = func except AttributeError: # Not a no... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sobolevn |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| 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 | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width