Title: gh-104374: don't inline comprehensions in non-function scopes by carljm · Pull Request #104519 · python/cpython · GitHub
Open Graph Title: gh-104374: don't inline comprehensions in non-function scopes by carljm · Pull Request #104519 · python/cpython
X Title: gh-104374: don't inline comprehensions in non-function scopes by carljm · Pull Request #104519 · python/cpython
Description: This PR updates and adds comprehension tests to mandate the same scoping and name-visibility rules as in Python 3.11, including in class scopes. These are the changes in Lib/tests/test_listcomps.py. Then there is one change in Python/symtable.c, to only inline comprehensions that occur within functions. The rest of the PR is purely a partial rollback of #101441, removing those parts of the implementation of PEP 709 that were required only for inlining module and class-level comprehensions. Issue: gh-104374
Open Graph Description: This PR updates and adds comprehension tests to mandate the same scoping and name-visibility rules as in Python 3.11, including in class scopes. These are the changes in Lib/tests/test_listcomps.py...
X Description: This PR updates and adds comprehension tests to mandate the same scoping and name-visibility rules as in Python 3.11, including in class scopes. These are the changes in Lib/tests/test_listcomps.py...
Opengraph URL: https://github.com/python/cpython/pull/104519
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:9c998308-65c3-1bef-e2c6-bcef50ab3a88 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E928:2EC32E:147996:1B2476:6969BCBC |
| html-safe-nonce | 5b82e59f0d9edcdb0caa5a9a932dc3a12c34439be274449a22fee0282f074b08 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOTI4OjJFQzMyRToxNDc5OTY6MUIyNDc2OjY5NjlCQ0JDIiwidmlzaXRvcl9pZCI6Ijc0MTEzNDI2MjY3MTYyMTMwOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a85e374294d5e060b4bdc2a6d9fc3aba470f3b81b5664be215e50433e185eba4 |
| hovercard-subject-tag | pull_request:1351628641 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/python/cpython/pull/104519/files |
| twitter:image | https://avatars.githubusercontent.com/u/61586?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/61586?s=400&v=4 |
| og:image:alt | This PR updates and adds comprehension tests to mandate the same scoping and name-visibility rules as in Python 3.11, including in class scopes. These are the changes in Lib/tests/test_listcomps.py... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | acedec8b5f975d9e3d494ddd8f949b0b8a0de59d393901e26f73df9dcba80056 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 83c08c21cdda978090dc44364b71aa5bc6dcea79 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width