René's URL Explorer Experiment


Title: bpo-37757: Disallow PEP 572 cases that expose implementation details by ncoghlan · Pull Request #15131 · python/cpython · GitHub

Open Graph Title: bpo-37757: Disallow PEP 572 cases that expose implementation details by ncoghlan · Pull Request #15131 · python/cpython

X Title: bpo-37757: Disallow PEP 572 cases that expose implementation details by ncoghlan · Pull Request #15131 · 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) 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/15131

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:6f30f3e4-a7b1-43ba-bec4-b5f631abde6a
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idAEF0:21C9D6:D70FBC:11E0389:6A540DC3
html-safe-nonceb77a8356be113678f35ab481628c90765e82810bf05bea489ea6f15875df6f86
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRUYwOjIxQzlENjpENzBGQkM6MTFFMDM4OTo2QTU0MERDMyIsInZpc2l0b3JfaWQiOiI1Mjg0ODEwMTc0MDYxODc0NjI3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmace9970fd1041b7cec518664afeaba9a72d8ed3226ac50f0da853acfb17caf0972
hovercard-subject-tagpull_request:304134422
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/15131/files
twitter:imagehttps://avatars.githubusercontent.com/u/1026649?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1026649?s=400&v=4
og:image:altdrop 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_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneb9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release07a982c1d40157c619b364352b704c3ce66bb332
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/15131/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F15131%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F15131%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/15131/files
Reloadhttps://github.com/python/cpython/pull/15131/files
Reloadhttps://github.com/python/cpython/pull/15131/files
Please reload this pagehttps://github.com/python/cpython/pull/15131/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/15131/files
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 35k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 73.8k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.3k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality 0 https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
ncoghlanhttps://github.com/ncoghlan
python:masterhttps://github.com/python/cpython/tree/master
ncoghlan:bpo-37757-targetscopeerror-for-iteration-variable-conflictshttps://github.com/ncoghlan/cpython/tree/bpo-37757-targetscopeerror-for-iteration-variable-conflicts
Conversation 13 https://github.com/python/cpython/pull/15131
Commits 10 https://github.com/python/cpython/pull/15131/commits
Checks 0 https://github.com/python/cpython/pull/15131/checks
Files changed https://github.com/python/cpython/pull/15131/files
Please reload this pagehttps://github.com/python/cpython/pull/15131/files
bpo-37757: Disallow PEP 572 cases that expose implementation details https://github.com/python/cpython/pull/15131/files#top
Show all changes 10 commits https://github.com/python/cpython/pull/15131/files
8d2a921 Bug #37757: Raise TargetScopeError as specified in PEP 572 ncoghlan Aug 5, 2019 https://github.com/python/cpython/pull/15131/commits/8d2a921a094a94e191373c69460dac3a060ca003
cf0c6c7 Add NEWS entry ncoghlan Aug 5, 2019 https://github.com/python/cpython/pull/15131/commits/cf0c6c72840469a1c2cf223ed002a0981ba264ba
c0f2b5b Close nested comprehension and lambda expression loopholes ncoghlan Aug 5, 2019 https://github.com/python/cpython/pull/15131/commits/c0f2b5bfa7f3b0318493a5d663ac59cf3f705df0
b337527 Iterable, not iterator ncoghlan Aug 9, 2019 https://github.com/python/cpython/pull/15131/commits/b3375276376814d12e03e4376d20d74e27a850f9
34f0c49 Drop TargetScopeError in favour of SyntaxError ncoghlan Aug 9, 2019 https://github.com/python/cpython/pull/15131/commits/34f0c495c77fb9f7c847b422da66ec09115e92a0
b1c109e Tweak details of exception messages ncoghlan Aug 9, 2019 https://github.com/python/cpython/pull/15131/commits/b1c109e5a05075ef375e4a7864b7b725bc8608e1
1cf1ae8 Fix/clarify comments ncoghlan Aug 14, 2019 https://github.com/python/cpython/pull/15131/commits/1cf1ae8e5d87d84ce845f16a40252a8f8cc33244
40307d5 Add comment for iteration variable marking ncoghlan Aug 14, 2019 https://github.com/python/cpython/pull/15131/commits/40307d59f51b2623befe68b1a7d051537364fa75
532cf12 Cover more potentially different cases in new tests ncoghlan Aug 14, 2019 https://github.com/python/cpython/pull/15131/commits/532cf125f4d50f23fc4eb8dbda46ff5d0d7910c9
4ee6cc0 Remove unused variable from test case ncoghlan Aug 25, 2019 https://github.com/python/cpython/pull/15131/commits/4ee6cc0f76d9a1bb06a2fffd6e5104596c6602b0
Clear filters https://github.com/python/cpython/pull/15131/files
Please reload this pagehttps://github.com/python/cpython/pull/15131/files
Please reload this pagehttps://github.com/python/cpython/pull/15131/files
exceptions.rst https://github.com/python/cpython/pull/15131/files#diff-72a55970b70280a1355dd73f4faffc95c8167e778dd8682b342a8ff9c092749a
pyerrors.h https://github.com/python/cpython/pull/15131/files#diff-f4e5b9de4e18de8d6f51895b1c99ccfcbee733b25d9027a7e5f74985f3e920db
symtable.h https://github.com/python/cpython/pull/15131/files#diff-78b6d47804f67fe47ac9f108077cf57c0c9491e92ff18e64cafcb81da73cea6a
_compat_pickle.py https://github.com/python/cpython/pull/15131/files#diff-3b5040f0205f9181a821ff7afca1bbf2ac8d43c2b22c0cd6f5857ad8806a8f79
exception_hierarchy.txt https://github.com/python/cpython/pull/15131/files#diff-a6efa445d967903c8fb4866aea8fe34f5e13d041b230cc862aaaab2294ff9db0
test_named_expressions.py https://github.com/python/cpython/pull/15131/files#diff-4a4a4c48508e5753e128a68e37d611bf80f7847375cfa8445eb32e44f96f604b
2019-08-05-14-22-59.bpo-37757.lRv5HX.rst https://github.com/python/cpython/pull/15131/files#diff-04339312773958bcd87be254807299a3eeeed012965ac3cf148051c954fd3e3f
exceptions.c https://github.com/python/cpython/pull/15131/files#diff-96c4ad902cdfac48712fef8fff0d0c78a71eb135fb48264f3ebb67db1013fc94
python3.def https://github.com/python/cpython/pull/15131/files#diff-a047a3ba52889584c613807fad7e2aa6797b2694868f756dd5bc05667f013497
symtable.c https://github.com/python/cpython/pull/15131/files#diff-1029343b7709f438c869082355577469b5aa784b454afa461ca2844ce9910ea6
Doc/c-api/exceptions.rsthttps://github.com/python/cpython/pull/15131/files#diff-72a55970b70280a1355dd73f4faffc95c8167e778dd8682b342a8ff9c092749a
View file https://github.com/ncoghlan/cpython/blob/4ee6cc0f76d9a1bb06a2fffd6e5104596c6602b0/Doc/c-api/exceptions.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/15131/{{ revealButtonHref }}
https://github.com/python/cpython/pull/15131/files#diff-72a55970b70280a1355dd73f4faffc95c8167e778dd8682b342a8ff9c092749a
https://github.com/python/cpython/pull/15131/files#diff-72a55970b70280a1355dd73f4faffc95c8167e778dd8682b342a8ff9c092749a
https://github.com/python/cpython/pull/15131/files#diff-72a55970b70280a1355dd73f4faffc95c8167e778dd8682b342a8ff9c092749a
https://github.com/python/cpython/pull/15131/files#diff-72a55970b70280a1355dd73f4faffc95c8167e778dd8682b342a8ff9c092749a
Include/pyerrors.hhttps://github.com/python/cpython/pull/15131/files#diff-f4e5b9de4e18de8d6f51895b1c99ccfcbee733b25d9027a7e5f74985f3e920db
View file https://github.com/ncoghlan/cpython/blob/4ee6cc0f76d9a1bb06a2fffd6e5104596c6602b0/Include/pyerrors.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/15131/{{ revealButtonHref }}
https://github.com/python/cpython/pull/15131/files#diff-f4e5b9de4e18de8d6f51895b1c99ccfcbee733b25d9027a7e5f74985f3e920db
https://github.com/python/cpython/pull/15131/files#diff-f4e5b9de4e18de8d6f51895b1c99ccfcbee733b25d9027a7e5f74985f3e920db
Include/symtable.hhttps://github.com/python/cpython/pull/15131/files#diff-78b6d47804f67fe47ac9f108077cf57c0c9491e92ff18e64cafcb81da73cea6a
View file https://github.com/ncoghlan/cpython/blob/4ee6cc0f76d9a1bb06a2fffd6e5104596c6602b0/Include/symtable.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/15131/{{ revealButtonHref }}
https://github.com/python/cpython/pull/15131/files#diff-78b6d47804f67fe47ac9f108077cf57c0c9491e92ff18e64cafcb81da73cea6a
https://github.com/python/cpython/pull/15131/files#diff-78b6d47804f67fe47ac9f108077cf57c0c9491e92ff18e64cafcb81da73cea6a
https://github.com/python/cpython/pull/15131/files#diff-78b6d47804f67fe47ac9f108077cf57c0c9491e92ff18e64cafcb81da73cea6a
https://github.com/python/cpython/pull/15131/files#diff-78b6d47804f67fe47ac9f108077cf57c0c9491e92ff18e64cafcb81da73cea6a
Lib/_compat_pickle.pyhttps://github.com/python/cpython/pull/15131/files#diff-3b5040f0205f9181a821ff7afca1bbf2ac8d43c2b22c0cd6f5857ad8806a8f79
View file https://github.com/ncoghlan/cpython/blob/4ee6cc0f76d9a1bb06a2fffd6e5104596c6602b0/Lib/_compat_pickle.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/15131/{{ revealButtonHref }}
https://github.com/python/cpython/pull/15131/files#diff-3b5040f0205f9181a821ff7afca1bbf2ac8d43c2b22c0cd6f5857ad8806a8f79
https://github.com/python/cpython/pull/15131/files#diff-3b5040f0205f9181a821ff7afca1bbf2ac8d43c2b22c0cd6f5857ad8806a8f79
Lib/test/exception_hierarchy.txthttps://github.com/python/cpython/pull/15131/files#diff-a6efa445d967903c8fb4866aea8fe34f5e13d041b230cc862aaaab2294ff9db0
View file https://github.com/ncoghlan/cpython/blob/4ee6cc0f76d9a1bb06a2fffd6e5104596c6602b0/Lib/test/exception_hierarchy.txt
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/15131/{{ revealButtonHref }}
https://github.com/python/cpython/pull/15131/files#diff-a6efa445d967903c8fb4866aea8fe34f5e13d041b230cc862aaaab2294ff9db0
https://github.com/python/cpython/pull/15131/files#diff-a6efa445d967903c8fb4866aea8fe34f5e13d041b230cc862aaaab2294ff9db0
Lib/test/test_named_expressions.pyhttps://github.com/python/cpython/pull/15131/files#diff-4a4a4c48508e5753e128a68e37d611bf80f7847375cfa8445eb32e44f96f604b
View file https://github.com/ncoghlan/cpython/blob/4ee6cc0f76d9a1bb06a2fffd6e5104596c6602b0/Lib/test/test_named_expressions.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/15131/{{ revealButtonHref }}
https://github.com/python/cpython/pull/15131/files#diff-4a4a4c48508e5753e128a68e37d611bf80f7847375cfa8445eb32e44f96f604b
https://github.com/python/cpython/pull/15131/files#diff-4a4a4c48508e5753e128a68e37d611bf80f7847375cfa8445eb32e44f96f604b
https://github.com/python/cpython/pull/15131/files#diff-4a4a4c48508e5753e128a68e37d611bf80f7847375cfa8445eb32e44f96f604b
https://github.com/python/cpython/pull/15131/files#diff-4a4a4c48508e5753e128a68e37d611bf80f7847375cfa8445eb32e44f96f604b
https://github.com/python/cpython/pull/15131/files#diff-4a4a4c48508e5753e128a68e37d611bf80f7847375cfa8445eb32e44f96f604b
Misc/NEWS.d/next/Core and Builtins/2019-08-05-14-22-59.bpo-37757.lRv5HX.rsthttps://github.com/python/cpython/pull/15131/files#diff-04339312773958bcd87be254807299a3eeeed012965ac3cf148051c954fd3e3f
View file https://github.com/ncoghlan/cpython/blob/4ee6cc0f76d9a1bb06a2fffd6e5104596c6602b0/Misc/NEWS.d/next/Core%20and%20Builtins/2019-08-05-14-22-59.bpo-37757.lRv5HX.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/15131/{{ revealButtonHref }}
Objects/exceptions.chttps://github.com/python/cpython/pull/15131/files#diff-96c4ad902cdfac48712fef8fff0d0c78a71eb135fb48264f3ebb67db1013fc94
View file https://github.com/ncoghlan/cpython/blob/4ee6cc0f76d9a1bb06a2fffd6e5104596c6602b0/Objects/exceptions.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/15131/{{ revealButtonHref }}
https://github.com/python/cpython/pull/15131/files#diff-96c4ad902cdfac48712fef8fff0d0c78a71eb135fb48264f3ebb67db1013fc94
https://github.com/python/cpython/pull/15131/files#diff-96c4ad902cdfac48712fef8fff0d0c78a71eb135fb48264f3ebb67db1013fc94
https://github.com/python/cpython/pull/15131/files#diff-96c4ad902cdfac48712fef8fff0d0c78a71eb135fb48264f3ebb67db1013fc94
https://github.com/python/cpython/pull/15131/files#diff-96c4ad902cdfac48712fef8fff0d0c78a71eb135fb48264f3ebb67db1013fc94
https://github.com/python/cpython/pull/15131/files#diff-96c4ad902cdfac48712fef8fff0d0c78a71eb135fb48264f3ebb67db1013fc94
https://github.com/python/cpython/pull/15131/files#diff-96c4ad902cdfac48712fef8fff0d0c78a71eb135fb48264f3ebb67db1013fc94
PC/python3.defhttps://github.com/python/cpython/pull/15131/files#diff-a047a3ba52889584c613807fad7e2aa6797b2694868f756dd5bc05667f013497
View file https://github.com/ncoghlan/cpython/blob/4ee6cc0f76d9a1bb06a2fffd6e5104596c6602b0/PC/python3.def
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/15131/{{ revealButtonHref }}
https://github.com/python/cpython/pull/15131/files#diff-a047a3ba52889584c613807fad7e2aa6797b2694868f756dd5bc05667f013497
https://github.com/python/cpython/pull/15131/files#diff-a047a3ba52889584c613807fad7e2aa6797b2694868f756dd5bc05667f013497
Please reload this pagehttps://github.com/python/cpython/pull/15131/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.