René's URL Explorer Experiment


Title: gh-117348: Refactored RawConfigParser._read for simplicity and comprehensibility by jaraco · Pull Request #117372 · python/cpython · GitHub

Open Graph Title: gh-117348: Refactored RawConfigParser._read for simplicity and comprehensibility by jaraco · Pull Request #117372 · python/cpython

X Title: gh-117348: Refactored RawConfigParser._read for simplicity and comprehensibility by jaraco · Pull Request #117372 · python/cpython

Description: The Python programming language. Contribute to python/cpython development by creating an account on GitHub.

Open Graph Description: Extract method for _read_inner, reducing complexity and indentation by 1. Extract method for _raise_all and yield ParseErrors from _read_inner. Prefer iterators to splat expansion and literal index...

X Description: Extract method for _read_inner, reducing complexity and indentation by 1. Extract method for _raise_all and yield ParseErrors from _read_inner. Prefer iterators to splat expansion and literal index...

Opengraph URL: https://github.com/python/cpython/pull/117372

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/commits(.:format)
route-controllerpull_requests
route-actioncommits
fetch-noncev2:be772012-85e0-28f4-014b-dad362f8ed26
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC872:2F543F:1A32565:229DC7A:6B021816
html-safe-nonce26f2dcd0e83c823276ba1ce4d428b241c0b1ed061313bd91464380aaa9c2e8ae
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODcyOjJGNTQzRjoxQTMyNTY1OjIyOURDN0E6NkIwMjE4MTYiLCJ2aXNpdG9yX2lkIjoiMzU4MDQxNjA1MzA0ODgzMjIyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac8d73d62aa8270adecb6dfc08c46c904721e70443b99413d84cff7f9387f98a08
hovercard-subject-tagpull_request:1798220960
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/commits
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/117372/commits
twitter:imagehttps://opengraph.githubassets.com/88759aebb751c9ed85becec01ae47700a3bdb36d7102a49ca55ad96c97cf2a45/python/cpython/pull/117372
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/88759aebb751c9ed85becec01ae47700a3bdb36d7102a49ca55ad96c97cf2a45/python/cpython/pull/117372
og:image:altExtract method for _read_inner, reducing complexity and indentation by 1. Extract method for _raise_all and yield ParseErrors from _read_inner. Prefer iterators to splat expansion and literal index...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejaraco
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-cache
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-namepull-requests

Links:

Skip to contenthttps://github.com/python/cpython/pull/117372/commits#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F117372%2Fcommits
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F117372%2Fcommits
Sign uphttps://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%2Fcommits&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/117372/commits
Reloadhttps://github.com/python/cpython/pull/117372/commits
Reloadhttps://github.com/python/cpython/pull/117372/commits
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
jaracohttps://github.com/jaraco
python:mainhttps://github.com/python/cpython/tree/main
jaraco:feature/refactor-configparser-read-complexityhttps://github.com/jaraco/cpython/tree/feature/refactor-configparser-read-complexity
Conversationhttps://github.com/python/cpython/pull/117372
Commits23 (23)https://github.com/python/cpython/pull/117372/commits
Checkshttps://github.com/python/cpython/pull/117372/checks
Files changedhttps://github.com/python/cpython/pull/117372/files
gh-117348: Refactored RawConfigParser._read for simplicity and comprehensibilityhttps://github.com/python/cpython/pull/117372/commits#top
jaracohttps://github.com/jaraco
python:mainhttps://github.com/python/cpython/tree/main
jaraco:feature/refactor-configparser-read-complexityhttps://github.com/jaraco/cpython/tree/feature/refactor-configparser-read-complexity
Extract method for _read_inner, reducing complexity and indentation by 1.https://github.com/python/cpython/pull/117372/commits/a25ac002617c9756cd0f4ff8f0d0692134006592
https://github.com/jaraco
jaracohttps://github.com/python/cpython/commits?author=jaraco
a25ac00https://github.com/python/cpython/pull/117372/commits/a25ac002617c9756cd0f4ff8f0d0692134006592
https://github.com/python/cpython/tree/a25ac002617c9756cd0f4ff8f0d0692134006592
Extract method for _raise_all and yield ParseErrors from _read_inner.https://github.com/python/cpython/pull/117372/commits/1e69aaecf0ae53540b798b698ee2ca7a7a243aab
https://github.com/jaraco
jaracohttps://github.com/python/cpython/commits?author=jaraco
1e69aaehttps://github.com/python/cpython/pull/117372/commits/1e69aaecf0ae53540b798b698ee2ca7a7a243aab
https://github.com/python/cpython/tree/1e69aaecf0ae53540b798b698ee2ca7a7a243aab
Prefer iterators to splat expansion and literal indexing.https://github.com/python/cpython/pull/117372/commits/8c4778136e1f119b864838772986b2ea3252ec43
https://github.com/jaraco
jaracohttps://github.com/python/cpython/commits?author=jaraco
8c47781https://github.com/python/cpython/pull/117372/commits/8c4778136e1f119b864838772986b2ea3252ec43
https://github.com/python/cpython/tree/8c4778136e1f119b864838772986b2ea3252ec43
Extract method for _strip_comments. Reduces complexity by 7.https://github.com/python/cpython/pull/117372/commits/74798147d91270f8b084b4eadce18462e3ec871c
https://github.com/jaraco
jaracohttps://github.com/python/cpython/commits?author=jaraco
7479814https://github.com/python/cpython/pull/117372/commits/74798147d91270f8b084b4eadce18462e3ec871c
https://github.com/python/cpython/tree/74798147d91270f8b084b4eadce18462e3ec871c
Model the file lines in a class to encapsulate the comment status and cleaned value.https://github.com/python/cpython/pull/117372/commits/a2fffee5d8d4b5122f0671acd7101743ba99c048
https://github.com/jaraco
jaracohttps://github.com/python/cpython/commits?author=jaraco
a2fffeehttps://github.com/python/cpython/pull/117372/commits/a2fffee5d8d4b5122f0671acd7101743ba99c048
https://github.com/python/cpython/tree/a2fffee5d8d4b5122f0671acd7101743ba99c048
Encapsulate the read state as a dataclasshttps://github.com/python/cpython/pull/117372/commits/23468cbaac87924417af3bce3f608289696a0bef
https://github.com/jaraco
jaracohttps://github.com/python/cpython/commits?author=jaraco
23468cbhttps://github.com/python/cpython/pull/117372/commits/23468cbaac87924417af3bce3f608289696a0bef
https://github.com/python/cpython/tree/23468cbaac87924417af3bce3f608289696a0bef
Extract _handle_continuation_line and _handle_rest methods. Reduces complexity by 8.https://github.com/python/cpython/pull/117372/commits/3d1ef0a7b05c9c05c75942e01f99a9feaf27e70f
https://github.com/jaraco
jaracohttps://github.com/python/cpython/commits?author=jaraco
3d1ef0ahttps://github.com/python/cpython/pull/117372/commits/3d1ef0a7b05c9c05c75942e01f99a9feaf27e70f
https://github.com/python/cpython/tree/3d1ef0a7b05c9c05c75942e01f99a9feaf27e70f
Reindenthttps://github.com/python/cpython/pull/117372/commits/071baeb766e90a4d3e43ceed8ed1580e34e5eb0a
https://github.com/jaraco
jaracohttps://github.com/python/cpython/commits?author=jaraco
071baebhttps://github.com/python/cpython/pull/117372/commits/071baeb766e90a4d3e43ceed8ed1580e34e5eb0a
https://github.com/python/cpython/tree/071baeb766e90a4d3e43ceed8ed1580e34e5eb0a
At least for now, collect errors in the ReadStatehttps://github.com/python/cpython/pull/117372/commits/81f4ce2a52026656bbca67e86415dd19f81be8d9
https://github.com/jaraco
jaracohttps://github.com/python/cpython/commits?author=jaraco
81f4ce2https://github.com/python/cpython/pull/117372/commits/81f4ce2a52026656bbca67e86415dd19f81be8d9
https://github.com/python/cpython/tree/81f4ce2a52026656bbca67e86415dd19f81be8d9
Check for missing section header separately.https://github.com/python/cpython/pull/117372/commits/8942cc1522b5835e36df5a1cd04f7243b3b40de7
https://github.com/jaraco
jaracohttps://github.com/python/cpython/commits?author=jaraco
8942cc1https://github.com/python/cpython/pull/117372/commits/8942cc1522b5835e36df5a1cd04f7243b3b40de7
https://github.com/python/cpython/tree/8942cc1522b5835e36df5a1cd04f7243b3b40de7
Extract methods for _handle_header and _handle_option. Reduces complexity by 6.https://github.com/python/cpython/pull/117372/commits/1e72168d04d9d35c0b1e5a64496fab64de329e07
https://github.com/jaraco
jaracohttps://github.com/python/cpython/commits?author=jaraco
1e72168https://github.com/python/cpython/pull/117372/commits/1e72168d04d9d35c0b1e5a64496fab64de329e07
https://github.com/python/cpython/tree/1e72168d04d9d35c0b1e5a64496fab64de329e07
Remove unreachable code. Reduces complexity by 4.https://github.com/python/cpython/pull/117372/commits/0dfd797486420506be9ec92db15f8f001b237414
https://github.com/jaraco
jaracohttps://github.com/python/cpython/commits?author=jaraco
0dfd797https://github.com/python/cpython/pull/117372/commits/0dfd797486420506be9ec92db15f8f001b237414
https://github.com/python/cpython/tree/0dfd797486420506be9ec92db15f8f001b237414
Remove unreachable branchhttps://github.com/python/cpython/pull/117372/commits/77ed897299011cc7a288ba91caa6f7e97f80b2fb
https://github.com/jaraco
jaracohttps://github.com/python/cpython/commits?author=jaraco
77ed897https://github.com/python/cpython/pull/117372/commits/77ed897299011cc7a288ba91caa6f7e97f80b2fb
https://github.com/python/cpython/tree/77ed897299011cc7a288ba91caa6f7e97f80b2fb
Handle error condition early. Reduces complexity by 1.https://github.com/python/cpython/pull/117372/commits/76f42d3d856db5d5c0230b9d3ca47885608692af
https://github.com/jaraco
jaracohttps://github.com/python/cpython/commits?author=jaraco
76f42d3https://github.com/python/cpython/pull/117372/commits/76f42d3d856db5d5c0230b9d3ca47885608692af
https://github.com/python/cpython/tree/76f42d3d856db5d5c0230b9d3ca47885608692af
Add blurbhttps://github.com/python/cpython/pull/117372/commits/c18a2bb75844e132b35ab9560d5c6a38bdd8033f
https://github.com/jaraco
jaracohttps://github.com/python/cpython/commits?author=jaraco
c18a2bbhttps://github.com/python/cpython/pull/117372/commits/c18a2bb75844e132b35ab9560d5c6a38bdd8033f
https://github.com/python/cpython/tree/c18a2bb75844e132b35ab9560d5c6a38bdd8033f
Move _raise_all to ParsingError, as its behavior is most closely related to the exception class and not the reader.https://github.com/python/cpython/pull/117372/commits/97aa785854da308047bd3026b59ee2fea73cbbac
https://github.com/jaraco
jaracohttps://github.com/python/cpython/commits?author=jaraco
97aa785https://github.com/python/cpython/pull/117372/commits/97aa785854da308047bd3026b59ee2fea73cbbac
https://github.com/python/cpython/tree/97aa785854da308047bd3026b59ee2fea73cbbac
Split _strip* into separate methods.https://github.com/python/cpython/pull/117372/commits/d310cb404a0e9f3b5b0270f1008ca510ab8065db
https://github.com/jaraco
jaracohttps://github.com/python/cpython/commits?author=jaraco
d310cb4https://github.com/python/cpython/pull/117372/commits/d310cb404a0e9f3b5b0270f1008ca510ab8065db
https://github.com/python/cpython/tree/d310cb404a0e9f3b5b0270f1008ca510ab8065db
Refactor _strip_full to compute the strip just once and use 'not any' to determine the factor.https://github.com/python/cpython/pull/117372/commits/f2a355cd7cf45099133ab8b292b04a757466ba1b
https://github.com/jaraco
jaracohttps://github.com/python/cpython/commits?author=jaraco
f2a355chttps://github.com/python/cpython/pull/117372/commits/f2a355cd7cf45099133ab8b292b04a757466ba1b
https://github.com/python/cpython/tree/f2a355cd7cf45099133ab8b292b04a757466ba1b
Replace use of 'sys.maxsize' with direct computation of the stripped value.https://github.com/python/cpython/pull/117372/commits/249261416824eec48d70ae45103263f223d46eae
https://github.com/jaraco
jaracohttps://github.com/python/cpython/commits?author=jaraco
2492614https://github.com/python/cpython/pull/117372/commits/249261416824eec48d70ae45103263f223d46eae
https://github.com/python/cpython/tree/249261416824eec48d70ae45103263f223d46eae
Extract has_comments as a dynamic property.https://github.com/python/cpython/pull/117372/commits/496859151f009d6c3cbf38ece82524291048fc12
https://github.com/jaraco
jaracohttps://github.com/python/cpython/commits?author=jaraco
4968591https://github.com/python/cpython/pull/117372/commits/496859151f009d6c3cbf38ece82524291048fc12
https://github.com/python/cpython/tree/496859151f009d6c3cbf38ece82524291048fc12
Implement clean as a cached property.https://github.com/python/cpython/pull/117372/commits/7d807bba8cc70a926af16261abdf50e98be6a94f
https://github.com/jaraco
jaracohttps://github.com/python/cpython/commits?author=jaraco
7d807bbhttps://github.com/python/cpython/pull/117372/commits/7d807bba8cc70a926af16261abdf50e98be6a94f
https://github.com/python/cpython/tree/7d807bba8cc70a926af16261abdf50e98be6a94f
Model comment prefixes in the RawConfigParser within a prefixes namespace.https://github.com/python/cpython/pull/117372/commits/29cb20f225216bc221e7b396eea1526157d83139
https://github.com/jaraco
jaracohttps://github.com/python/cpython/commits?author=jaraco
29cb20fhttps://github.com/python/cpython/pull/117372/commits/29cb20f225216bc221e7b396eea1526157d83139
https://github.com/python/cpython/tree/29cb20f225216bc221e7b396eea1526157d83139
Use a regular expression to search for the first match.https://github.com/python/cpython/pull/117372/commits/c834c356f72d07e03ad8ece49f72ebb4ee8759b4
https://github.com/jaraco
jaracohttps://github.com/python/cpython/commits?author=jaraco
c834c35https://github.com/python/cpython/pull/117372/commits/c834c356f72d07e03ad8ece49f72ebb4ee8759b4
https://github.com/python/cpython/tree/c834c356f72d07e03ad8ece49f72ebb4ee8759b4
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.