Title: Several type annotations in `_interpreters` and `_interpqueues` are wrong · Issue #13351 · python/typeshed · GitHub
Open Graph Title: Several type annotations in `_interpreters` and `_interpqueues` are wrong · Issue #13351 · python/typeshed
X Title: Several type annotations in `_interpreters` and `_interpqueues` are wrong · Issue #13351 · python/typeshed
Description: _interpreters.exec() is annotated as returning None, while on error it actually returns a namespace (though this fact is largely undocumented) _interpreters.exec() is annotated as only taking str as the code argument, though it's documen...
Open Graph Description: _interpreters.exec() is annotated as returning None, while on error it actually returns a namespace (though this fact is largely undocumented) _interpreters.exec() is annotated as only taking str a...
X Description: _interpreters.exec() is annotated as returning None, while on error it actually returns a namespace (though this fact is largely undocumented) _interpreters.exec() is annotated as only taking str a...
Opengraph URL: https://github.com/python/typeshed/issues/13351
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Several type annotations in `_interpreters` and `_interpqueues` are wrong","articleBody":"1. `_interpreters.exec()` is annotated as returning `None`, while on error it actually returns a `namespace` (though this fact is largely undocumented)\r\n2. `_interpreters.exec()` is annotated as only taking `str` as the `code` argument, though it's documented to also accept code objects:\r\n> Functions (and code objects) are also supported, with some restrictions.\r\n The code/function must not take any arguments or be a closure\r\n (i.e. have cell vars). Methods and other callables are not supported.\r\n3. `_interpqueues.create()` takes 3 mandatory arguments (`create(maxsize, fmt, unboundop) -> qid`), but the type stub says it takes 2\r\n4. `_interpqueues.get()` returns a 3-tuple (item, fmt, unboundop), not 2-tuple as annotated in typeshed\r\n5. `_interpqueues.put` takes 4 arguments (qid, item, fmt, unboundop), not 3 as annotated in typeshed (admittedly its own docstring is **also** wrong!)\r\n\r\nI believe the annotations may have been correct at the time they were added, but changes have been made to them in the CPython repository since then.","author":{"url":"https://github.com/agronholm","@type":"Person","name":"agronholm"},"datePublished":"2024-12-31T21:12:13Z","url":"https://github.com/python/typeshed/issues/13351"}
| 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:41137005-f2b1-b193-19f8-e22ac25482a8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DA48:2AD163:2B575F3:3B27DDB:6B0055B3 |
| html-safe-nonce | c14011a60d9222815e2cebce062e4bf0ba4769542eebf38a27407e3121f8741c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTQ4OjJBRDE2MzoyQjU3NUYzOjNCMjdEREI6NkIwMDU1QjMiLCJ2aXNpdG9yX2lkIjoiNjYyOTc3MDMxMzcwODA5ODk5NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a26a8e469be5b2866f7631a3be226fe9daac8c26c38b51233cb0934d7b7aa265 |
| hovercard-subject-tag | issue:2764677215 |
| 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/13351/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ae013f5b76badcf52166303b527e90005c461997ded7f815157fe4db0f801e76/python/typeshed/issues/13351 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ae013f5b76badcf52166303b527e90005c461997ded7f815157fe4db0f801e76/python/typeshed/issues/13351 |
| og:image:alt | _interpreters.exec() is annotated as returning None, while on error it actually returns a namespace (though this fact is largely undocumented) _interpreters.exec() is annotated as only taking str a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | agronholm |
| hostname | github.com |
| expected-hostname | github.com |
| None | f420f4996e6b1ff1ccd6d7683f8134f4b5f0f8a50124c210dbfe7490e5644abb |
| 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 | 26e00df917aba0f128135dc073ea0c5e33a70d40 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width