Title: eval() documentation is wrong about keyword arguments · Issue #100546 · python/cpython · GitHub
Open Graph Title: eval() documentation is wrong about keyword arguments · Issue #100546 · python/cpython
X Title: eval() documentation is wrong about keyword arguments · Issue #100546 · python/cpython
Description: Documentation The docs for eval() say it takes keyword arguments, which is incorrect: eval(expression, /, globals=None, locals=None) For example: >>> eval('a', locals={'a': 0}) ... TypeError: eval() takes no keyword arguments Meanwhile, ...
Open Graph Description: Documentation The docs for eval() say it takes keyword arguments, which is incorrect: eval(expression, /, globals=None, locals=None) For example: >>> eval('a', locals={'a': 0}) ... TypeError: eval(...
X Description: Documentation The docs for eval() say it takes keyword arguments, which is incorrect: eval(expression, /, globals=None, locals=None) For example: >>> eval('a', locals={'a':...
Opengraph URL: https://github.com/python/cpython/issues/100546
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"eval() documentation is wrong about keyword arguments","articleBody":"# Documentation\r\n\r\n[The docs for `eval()`](https://docs.python.org/3/library/functions.html#eval) say it takes keyword arguments, which is incorrect:\r\n```\r\neval(expression, /, globals=None, locals=None)\r\n```\r\n\r\nFor example:\r\n```\r\n\u003e\u003e\u003e eval('a', locals={'a': 0})\r\n ...\r\nTypeError: eval() takes no keyword arguments\r\n```\r\n\r\nMeanwhile, `help(eval)` has the correct signature:\r\n```\r\neval(source, globals=None, locals=None, /)\r\n```\r\n\r\nI found a previous, similar issue, #69996, which was resolved in #15173 (which shipped in 3.7) but then the syntax was changed in #96579 and [the same sort of mistake was added back](https://github.com/python/cpython/commit/3c4cbd177f36777a04e78eb07ce20367560a66d3#diff-6a7a07ac473fdd76734669b1b70626ad2176011129902f6add017810f54d0439R515) (which shipped in 3.11).\r\n\r\nThis issue is also similar:\r\n- #67926\r\n\r\n\u003c!-- gh-linked-prs --\u003e\r\n### Linked PRs\r\n* gh-100547\r\n* gh-100654\n\u003c!-- /gh-linked-prs --\u003e\r\n","author":{"url":"https://github.com/wjandrea","@type":"Person","name":"wjandrea"},"datePublished":"2022-12-26T23:40:47.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/100546/cpython/issues/100546"}
| 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:9d294cbe-73c7-38fa-37ba-de5b30f165f7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 92DE:FE029:ACD158:F163C5:6A4F4A01 |
| html-safe-nonce | b0fd483ad6a4c8644bdaa454b0bb3f032c496345b8ace77a3f385670bf7a95fc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MkRFOkZFMDI5OkFDRDE1ODpGMTYzQzU6NkE0RjRBMDEiLCJ2aXNpdG9yX2lkIjoiNDYxMTkwNzE1NTE5MjEzODI0MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 299cbfbe2de50f1930c73049c52bd821ff4d09eced6216da0c5885e3146393e2 |
| hovercard-subject-tag | issue:1511312391 |
| 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/100546/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c7937798acd0bd17e8174cba5245a6591a81cb0fff73100cf41d624974a4e92b/python/cpython/issues/100546 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c7937798acd0bd17e8174cba5245a6591a81cb0fff73100cf41d624974a4e92b/python/cpython/issues/100546 |
| og:image:alt | Documentation The docs for eval() say it takes keyword arguments, which is incorrect: eval(expression, /, globals=None, locals=None) For example: >>> eval('a', locals={'a': 0}) ... TypeError: eval(... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | wjandrea |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| 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 | 4b249b445842943ed31549e027f57a8ade9881ed |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width