Title: [3.8] bpo-37757: Disallow PEP 572 cases that expose implementation details by ncoghlan · Pull Request #15491 · python/cpython · GitHub
Open Graph Title: [3.8] bpo-37757: Disallow PEP 572 cases that expose implementation details by ncoghlan · Pull Request #15491 · python/cpython
X Title: [3.8] bpo-37757: Disallow PEP 572 cases that expose implementation details by ncoghlan · Pull Request #15491 · python/cpython
Description: drop TargetScopeError in favour of raising SyntaxError directly as per the updated PEP 572 comprehension iteration variables are explicitly local, but named expression targets in comprehensions are nonlocal or global. Raise SyntaxError as specified in PEP 572 named expression targets in the outermost iterable of a comprehension have an ambiguous target scope. Avoid resolving that question now by raising SyntaxError. PEP 572 originally required this only for cases where the bound name conflicts with the iteration variable in the comprehension, but CPython can't easily restrict the exception to that case (as it doesn't know the target variable names when visiting the outermost iterator expression) (cherry picked from commit 5dbe0f5) https://bugs.python.org/issue37757
Open Graph Description: drop TargetScopeError in favour of raising SyntaxError directly as per the updated PEP 572 comprehension iteration variables are explicitly local, but named expression targets in comprehensions are...
X Description: drop TargetScopeError in favour of raising SyntaxError directly as per the updated PEP 572 comprehension iteration variables are explicitly local, but named expression targets in comprehensions are...
Opengraph URL: https://github.com/python/cpython/pull/15491
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:0d8dba53-147e-506e-f784-6f9a8580184e |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B732:2A95D0:3D8B6E:5A4370:6A560A60 |
| html-safe-nonce | 7d59f86d37913f10c8cf8e3f0b8c135acb05dc8315732068eebfd99df28b0a44 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNzMyOjJBOTVEMDozRDhCNkU6NUE0MzcwOjZBNTYwQTYwIiwidmlzaXRvcl9pZCI6IjM5MzQyNzM0NTc0Nzk4NzkyNjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 90133bfd9b7b08caac0226d7fd1b7781b0bf47d59d3992586eee581d670eda44 |
| hovercard-subject-tag | pull_request:310688227 |
| 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/15491/files |
| twitter:image | https://avatars.githubusercontent.com/u/1026649?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1026649?s=400&v=4 |
| og:image:alt | drop TargetScopeError in favour of raising SyntaxError directly as per the updated PEP 572 comprehension iteration variables are explicitly local, but named expression targets in comprehensions are... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | f4368738fc918fecd9b3958f6b49218bbe60d4185f38e72e3954e11f1ad0213a |
| 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 | 85a7179838b41e8b23f939d3b67b53f752ecfc54 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width