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: 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 indexing. Extract method for _strip_comments. Reduces complexity by 7. Model the file lines in a class to encapsulate the comment status and cleaned value. Encapsulate the read state as a dataclass Extract _handle_continuation_line and _handle_rest methods. Reduces complexity by 8. Reindent At least for now, collect errors in the ReadState Check for missing section header separately. Extract methods for _handle_header and _handle_option. Reduces complexity by 6. Remove unreachable code. Reduces complexity by 4. Remove unreachable branch Handle error condition early. Reduces complexity by 1. Add blurb Issue: gh-117348

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/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:81f3d9f3-c5fe-8299-8712-b2c6f35654dd
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB0DC:1773CF:2F4BDC:3E69AC:6B023446
html-safe-nonce4962bb83421ce9e360d78c8b15c9190c1b2e0c07770b804fde9463eb86aedb40
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMERDOjE3NzNDRjoyRjRCREM6M0U2OUFDOjZCMDIzNDQ2IiwidmlzaXRvcl9pZCI6IjU5MjQ5NzYzNzIzOTIwMTQ5MTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac46a3030a4b1cf483074d5785ef4d57a30a868e25ee0d45ff23c555c730f22270
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/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/117372/files
twitter:imagehttps://avatars.githubusercontent.com/u/308610?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/308610?s=400&v=4
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:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
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
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/117372/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F117372%2Ffiles
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%2Ffiles
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%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/117372/files
Reloadhttps://github.com/python/cpython/pull/117372/files
Reloadhttps://github.com/python/cpython/pull/117372/files
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
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
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
Conversation 5 https://github.com/python/cpython/pull/117372
Commits 23 https://github.com/python/cpython/pull/117372/commits
Checks 0 https://github.com/python/cpython/pull/117372/checks
Files changed https://github.com/python/cpython/pull/117372/files
Please reload this pagehttps://github.com/python/cpython/pull/117372/files
gh-117348: Refactored RawConfigParser._read for simplicity and comprehensibility https://github.com/python/cpython/pull/117372/files#top
Show all changes 23 commits https://github.com/python/cpython/pull/117372/files
a25ac00 Extract method for _read_inner, reducing complexity and indentation b… jaraco Mar 27, 2024 https://github.com/python/cpython/pull/117372/commits/a25ac002617c9756cd0f4ff8f0d0692134006592
1e69aae Extract method for _raise_all and yield ParseErrors from _read_inner. jaraco Mar 27, 2024 https://github.com/python/cpython/pull/117372/commits/1e69aaecf0ae53540b798b698ee2ca7a7a243aab
8c47781 Prefer iterators to splat expansion and literal indexing. jaraco Mar 27, 2024 https://github.com/python/cpython/pull/117372/commits/8c4778136e1f119b864838772986b2ea3252ec43
7479814 Extract method for _strip_comments. Reduces complexity by 7. jaraco Mar 27, 2024 https://github.com/python/cpython/pull/117372/commits/74798147d91270f8b084b4eadce18462e3ec871c
a2fffee Model the file lines in a class to encapsulate the comment status and… jaraco Mar 28, 2024 https://github.com/python/cpython/pull/117372/commits/a2fffee5d8d4b5122f0671acd7101743ba99c048
23468cb Encapsulate the read state as a dataclass jaraco Mar 28, 2024 https://github.com/python/cpython/pull/117372/commits/23468cbaac87924417af3bce3f608289696a0bef
3d1ef0a Extract _handle_continuation_line and _handle_rest methods. Reduces c… jaraco Mar 28, 2024 https://github.com/python/cpython/pull/117372/commits/3d1ef0a7b05c9c05c75942e01f99a9feaf27e70f
071baeb Reindent jaraco Mar 28, 2024 https://github.com/python/cpython/pull/117372/commits/071baeb766e90a4d3e43ceed8ed1580e34e5eb0a
81f4ce2 At least for now, collect errors in the ReadState jaraco Mar 28, 2024 https://github.com/python/cpython/pull/117372/commits/81f4ce2a52026656bbca67e86415dd19f81be8d9
8942cc1 Check for missing section header separately. jaraco Mar 28, 2024 https://github.com/python/cpython/pull/117372/commits/8942cc1522b5835e36df5a1cd04f7243b3b40de7
1e72168 Extract methods for _handle_header and _handle_option. Reduces comple… jaraco Mar 28, 2024 https://github.com/python/cpython/pull/117372/commits/1e72168d04d9d35c0b1e5a64496fab64de329e07
0dfd797 Remove unreachable code. Reduces complexity by 4. jaraco Mar 28, 2024 https://github.com/python/cpython/pull/117372/commits/0dfd797486420506be9ec92db15f8f001b237414
77ed897 Remove unreachable branch jaraco Mar 28, 2024 https://github.com/python/cpython/pull/117372/commits/77ed897299011cc7a288ba91caa6f7e97f80b2fb
76f42d3 Handle error condition early. Reduces complexity by 1. jaraco Mar 28, 2024 https://github.com/python/cpython/pull/117372/commits/76f42d3d856db5d5c0230b9d3ca47885608692af
c18a2bb Add blurb jaraco Mar 29, 2024 https://github.com/python/cpython/pull/117372/commits/c18a2bb75844e132b35ab9560d5c6a38bdd8033f
97aa785 Move _raise_all to ParsingError, as its behavior is most closely rela… jaraco Mar 29, 2024 https://github.com/python/cpython/pull/117372/commits/97aa785854da308047bd3026b59ee2fea73cbbac
d310cb4 Split _strip* into separate methods. jaraco Mar 29, 2024 https://github.com/python/cpython/pull/117372/commits/d310cb404a0e9f3b5b0270f1008ca510ab8065db
f2a355c Refactor _strip_full to compute the strip just once and use 'not any'… jaraco Mar 29, 2024 https://github.com/python/cpython/pull/117372/commits/f2a355cd7cf45099133ab8b292b04a757466ba1b
2492614 Replace use of 'sys.maxsize' with direct computation of the stripped … jaraco Mar 29, 2024 https://github.com/python/cpython/pull/117372/commits/249261416824eec48d70ae45103263f223d46eae
4968591 Extract has_comments as a dynamic property. jaraco Mar 29, 2024 https://github.com/python/cpython/pull/117372/commits/496859151f009d6c3cbf38ece82524291048fc12
7d807bb Implement clean as a cached property. jaraco Mar 29, 2024 https://github.com/python/cpython/pull/117372/commits/7d807bba8cc70a926af16261abdf50e98be6a94f
29cb20f Model comment prefixes in the RawConfigParser within a prefixes names… jaraco Mar 29, 2024 https://github.com/python/cpython/pull/117372/commits/29cb20f225216bc221e7b396eea1526157d83139
c834c35 Use a regular expression to search for the first match. jaraco Mar 29, 2024 https://github.com/python/cpython/pull/117372/commits/c834c356f72d07e03ad8ece49f72ebb4ee8759b4
Clear filters https://github.com/python/cpython/pull/117372/files
Please reload this pagehttps://github.com/python/cpython/pull/117372/files
Please reload this pagehttps://github.com/python/cpython/pull/117372/files
configparser.py https://github.com/python/cpython/pull/117372/files#diff-ca80d44aeeadd5e4966195b99aff106abb3e7b0b5356b7499125ee021bd84777
2024-03-29-12-07-26.gh-issue-117348.WjCYvK.rst https://github.com/python/cpython/pull/117372/files#diff-c52c8c2717a0ae829a79a6d09510528bc6567d14d8a55d217028b6185657ea60
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L417
Lib/configparser.pyhttps://github.com/python/cpython/pull/117372/files#diff-ca80d44aeeadd5e4966195b99aff106abb3e7b0b5356b7499125ee021bd84777
View file https://github.com/jaraco/cpython/blob/c834c356f72d07e03ad8ece49f72ebb4ee8759b4/Lib/configparser.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/117372/{{ revealButtonHref }}
https://github.com/python/cpython/pull/117372/files#diff-ca80d44aeeadd5e4966195b99aff106abb3e7b0b5356b7499125ee021bd84777
https://github.com/python/cpython/pull/117372/files#diff-ca80d44aeeadd5e4966195b99aff106abb3e7b0b5356b7499125ee021bd84777
https://github.com/python/cpython/pull/117372/files#diff-ca80d44aeeadd5e4966195b99aff106abb3e7b0b5356b7499125ee021bd84777
https://github.com/python/cpython/pull/117372/files#diff-ca80d44aeeadd5e4966195b99aff106abb3e7b0b5356b7499125ee021bd84777
https://github.com/python/cpython/pull/117372/files#diff-ca80d44aeeadd5e4966195b99aff106abb3e7b0b5356b7499125ee021bd84777
https://github.com/python/cpython/pull/117372/files#diff-ca80d44aeeadd5e4966195b99aff106abb3e7b0b5356b7499125ee021bd84777
https://github.com/python/cpython/pull/117372/files#diff-ca80d44aeeadd5e4966195b99aff106abb3e7b0b5356b7499125ee021bd84777
https://github.com/python/cpython/pull/117372/files#diff-ca80d44aeeadd5e4966195b99aff106abb3e7b0b5356b7499125ee021bd84777
https://github.com/python/cpython/pull/117372/files#diff-ca80d44aeeadd5e4966195b99aff106abb3e7b0b5356b7499125ee021bd84777
https://github.com/python/cpython/pull/117372/files#diff-ca80d44aeeadd5e4966195b99aff106abb3e7b0b5356b7499125ee021bd84777
https://github.com/python/cpython/pull/117372/files#diff-ca80d44aeeadd5e4966195b99aff106abb3e7b0b5356b7499125ee021bd84777
Misc/NEWS.d/next/Library/2024-03-29-12-07-26.gh-issue-117348.WjCYvK.rsthttps://github.com/python/cpython/pull/117372/files#diff-c52c8c2717a0ae829a79a6d09510528bc6567d14d8a55d217028b6185657ea60
View file https://github.com/jaraco/cpython/blob/c834c356f72d07e03ad8ece49f72ebb4ee8759b4/Misc/NEWS.d/next/Library/2024-03-29-12-07-26.gh-issue-117348.WjCYvK.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/117372/{{ revealButtonHref }}
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.