Title: The documentation of MAKE_FUNCTION in Python 3.11 does not reflect the actual usage · Issue #93270 · python/cpython · GitHub
Open Graph Title: The documentation of MAKE_FUNCTION in Python 3.11 does not reflect the actual usage · Issue #93270 · python/cpython
X Title: The documentation of MAKE_FUNCTION in Python 3.11 does not reflect the actual usage · Issue #93270 · python/cpython
Description: Documentation The documentation for 3.11 (https://docs.python.org/3.11/library/dis.html#opcode-MAKE_FUNCTION) related to MAKE_FUNCTION seems to be the same for Python 3.10, which would expect 2 elements to be removed from the stack, yet,...
Open Graph Description: Documentation The documentation for 3.11 (https://docs.python.org/3.11/library/dis.html#opcode-MAKE_FUNCTION) related to MAKE_FUNCTION seems to be the same for Python 3.10, which would expect 2 ele...
X Description: Documentation The documentation for 3.11 (https://docs.python.org/3.11/library/dis.html#opcode-MAKE_FUNCTION) related to MAKE_FUNCTION seems to be the same for Python 3.10, which would expect 2 ele...
Opengraph URL: https://github.com/python/cpython/issues/93270
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"The documentation of MAKE_FUNCTION in Python 3.11 does not reflect the actual usage","articleBody":"**Documentation**\r\n\r\nThe documentation for 3.11 (https://docs.python.org/3.11/library/dis.html#opcode-MAKE_FUNCTION) related to `MAKE_FUNCTION` seems to be the same for Python 3.10, which would expect 2 elements to be removed from the stack, yet, it seems that only 1 element is removed from the stack (it appears that the qualifier is no longer there).\r\n\r\ni.e.:\r\nGiven: \r\n\r\n```\r\nimport dis\r\n\r\ndef func():\r\n def check():\r\n pass\r\n\r\ndis.dis(func)\r\n```\r\n\r\nThe output I have in 3.11 is:\r\n\r\n```\r\n 4 0 RESUME 0\r\n\r\n 5 2 LOAD_CONST 1 (\u003ccode object check at 0x000001F555E3EAD0, file \"W:\\pydev.debugger\\check\\snippet6.py\", line 5\u003e)\r\n 4 MAKE_FUNCTION 0\r\n 6 STORE_FAST 0 (check)\r\n 8 LOAD_CONST 0 (None)\r\n 10 RETURN_VALUE\r\n\r\nDisassembly of \u003ccode object check at 0x000001F555E3EAD0, file \"W:\\pydev.debugger\\check\\snippet6.py\", line 5\u003e:\r\n 5 0 RESUME 0\r\n\r\n 6 2 LOAD_CONST 0 (None)\r\n 4 RETURN_VALUE\r\n```\r\n\r\nand in 3.10 it is:\r\n\r\n```\r\n 5 0 LOAD_CONST 1 (\u003ccode object check at 0x000001F384D5D370, file \"W:\\pydev.debugger\\check\\snippet6.py\", line 5\u003e)\r\n 2 LOAD_CONST 2 ('func.\u003clocals\u003e.check')\r\n 4 MAKE_FUNCTION 0\r\n 6 STORE_FAST 0 (check)\r\n 8 LOAD_CONST 0 (None)\r\n 10 RETURN_VALUE\r\n\r\nDisassembly of \u003ccode object check at 0x000001F384D5D370, file \"W:\\pydev.debugger\\check\\snippet6.py\", line 5\u003e:\r\n 6 0 LOAD_CONST 0 (None)\r\n 2 RETURN_VALUE\r\n```\r\n\r\nThe `__qualname__` still seems to be set in the function (but that's probably happening through some other way now...).","author":{"url":"https://github.com/fabioz","@type":"Person","name":"fabioz"},"datePublished":"2022-05-26T19:55:22.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/93270/cpython/issues/93270"}
| 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:03b7fbd5-2326-1dbc-896e-88dffacbf846 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EBA6:39E51F:2F29048:3DAA79D:696B80DA |
| html-safe-nonce | 781afc47ed45751f9aa5decca7904b665b64686e6bfcdfe8e6c7e057a99dd460 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQkE2OjM5RTUxRjoyRjI5MDQ4OjNEQUE3OUQ6Njk2QjgwREEiLCJ2aXNpdG9yX2lkIjoiNjg4NjkzMjc2MDQyOTgyMjE3MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9c0d94fddb9301be40dbdffeb59f82e058e08e2d494f1aff1de9f795035e05c3 |
| hovercard-subject-tag | issue:1249982336 |
| 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/93270/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0bb455a260195ce8eb5838e6b8cf0dc8cbd18cd756bf831de9a95d81306d0f48/python/cpython/issues/93270 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0bb455a260195ce8eb5838e6b8cf0dc8cbd18cd756bf831de9a95d81306d0f48/python/cpython/issues/93270 |
| og:image:alt | Documentation The documentation for 3.11 (https://docs.python.org/3.11/library/dis.html#opcode-MAKE_FUNCTION) related to MAKE_FUNCTION seems to be the same for Python 3.10, which would expect 2 ele... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fabioz |
| 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