Title: Code objects, function objects and generator object contain quite a lot of redundant information · Issue #100719 · python/cpython · GitHub
Open Graph Title: Code objects, function objects and generator object contain quite a lot of redundant information · Issue #100719 · python/cpython
X Title: Code objects, function objects and generator object contain quite a lot of redundant information · Issue #100719 · python/cpython
Description: There is a quite a lot of redundancy in code, function and generator objects. Intra-object redundancy Code objects have four fields ,co_nlocalsplus, co_nplaincellvars, co_nlocals, co_nfreevars. Any of these fields can be computed from th...
Open Graph Description: There is a quite a lot of redundancy in code, function and generator objects. Intra-object redundancy Code objects have four fields ,co_nlocalsplus, co_nplaincellvars, co_nlocals, co_nfreevars. Any...
X Description: There is a quite a lot of redundancy in code, function and generator objects. Intra-object redundancy Code objects have four fields ,co_nlocalsplus, co_nplaincellvars, co_nlocals, co_nfreevars. Any...
Opengraph URL: https://github.com/python/cpython/issues/100719
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Code objects, function objects and generator object contain quite a lot of redundant information","articleBody":"There is a quite a lot of redundancy in code, function and generator objects.\r\n\r\n### Intra-object redundancy\r\n\r\n1. Code objects have four fields ,`co_nlocalsplus`, `co_nplaincellvars`, `co_nlocals`, `co_nfreevars`. Any of these fields can be computed from the other three.\r\n2. Code objects have a qualified name and a name. The name is always the suffix of the qualified name. Changing this to qualifying prefix and name would save space and allow sharing.\r\n3. The defaults and keyword defaults for a function are separate and the keyword defaults are a dict. They could be combined into a single array.\r\n4. Generator objects have a `gi_code` field, which is redundant, as the frame contains a reference to the code object.\r\n\r\n### Inter-object redundancy\r\n\r\n1. Functions and generators have qualified name and name fields, which are almost always the same as the underlying code object. These should be lazily initialized\r\n\r\n\r\n\r\n\r\n\r\n\u003c!-- gh-linked-prs --\u003e\r\n### Linked PRs\r\n* gh-100721\r\n* gh-100749\n\u003c!-- /gh-linked-prs --\u003e\r\n","author":{"url":"https://github.com/markshannon","@type":"Person","name":"markshannon"},"datePublished":"2023-01-03T16:36:24.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/100719/cpython/issues/100719"}
| 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:ec88d645-12f8-e928-ea9b-c824f223a47f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 84D6:26177F:4BCD93:610B1B:696B0C16 |
| html-safe-nonce | eb14471b952da906a31c6b244de7c0956571c2ae07c6bcc442bc859660220aeb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NEQ2OjI2MTc3Rjo0QkNEOTM6NjEwQjFCOjY5NkIwQzE2IiwidmlzaXRvcl9pZCI6IjQ4MTk1MDA0MDA4MTQ3ODc2MDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9b2dfcf914022bc344d06b5d1ab55a74a6f4f14e1c8b3d246bf28edcb5c65ef8 |
| hovercard-subject-tag | issue:1517643934 |
| 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/100719/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b531fd0d9803cc8ffcbf1a92696f747029db6cf9074aa9ee479fe6f933d3fc3a/python/cpython/issues/100719 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b531fd0d9803cc8ffcbf1a92696f747029db6cf9074aa9ee479fe6f933d3fc3a/python/cpython/issues/100719 |
| og:image:alt | There is a quite a lot of redundancy in code, function and generator objects. Intra-object redundancy Code objects have four fields ,co_nlocalsplus, co_nplaincellvars, co_nlocals, co_nfreevars. Any... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | markshannon |
| 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