René's URL Explorer Experiment


Title: Fix constants argument silently discarding Constants subclasses by derek73 · Pull Request #237 · derek73/python-nameparser · GitHub

Open Graph Title: Fix constants argument silently discarding Constants subclasses by derek73 · Pull Request #237 · derek73/python-nameparser

X Title: Fix constants argument silently discarding Constants subclasses by derek73 · Pull Request #237 · derek73/python-nameparser

Description: Summary The exact-type check in HumanName.__init__ (type(self.C) is not type(CONSTANTS)) silently replaced Constants subclass instances with fresh defaults, discarding the caller's configuration without any error (closes #226) Now validated explicitly: None → private per-instance Constants (unchanged); any Constants instance including subclasses → used as given; anything else → TypeError instead of a silent swap to defaults The constants annotation now admits None (always accepted and documented); fixed stale customize.rst prose ("pass something falsey" → only None; constant → constants keyword typo) Behavior notes Previously, garbage values (e.g. a string, or falsey values like ""/0) were silently replaced with fresh defaults; they now raise TypeError — called out in the release log Test plan Two tests written first (TDD, both verified failing): a customized Constants subclass instance is kept (assertIs) and honored by parsing; a non-Constants value raises TypeError Full suite 1360 passed / 22 xfailed (incl. doctests), mypy clean, Sphinx doctest build clean (docs prose changed) 🤖 Generated with Claude Code

Open Graph Description: Summary The exact-type check in HumanName.__init__ (type(self.C) is not type(CONSTANTS)) silently replaced Constants subclass instances with fresh defaults, discarding the caller's configurati...

X Description: Summary The exact-type check in HumanName.__init__ (type(self.C) is not type(CONSTANTS)) silently replaced Constants subclass instances with fresh defaults, discarding the caller's configu...

Opengraph URL: https://github.com/derek73/python-nameparser/pull/237

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:2d23f6ad-9117-653c-aef7-db4a8776d133
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE512:3DEC57:6456A20:8DE563E:6A57600D
html-safe-nonce35e9831b0ab6eb4e3b0aa4c33985ea07cf62b86e619870ee3e7412d97484b767
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTEyOjNERUM1Nzo2NDU2QTIwOjhERTU2M0U6NkE1NzYwMEQiLCJ2aXNpdG9yX2lkIjoiMzQzMDA5MzU5MDI2OTIyMjkyNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac46af5db9f8efa8dc411579e8b6df1cc50ef5d2e5b4b6ae5340486d0b8b380a69
hovercard-subject-tagpull_request:3995024663
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/derek73/python-nameparser/pull/237/files
twitter:imagehttps://avatars.githubusercontent.com/u/18306?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/18306?s=400&v=4
og:image:altSummary The exact-type check in HumanName.__init__ (type(self.C) is not type(CONSTANTS)) silently replaced Constants subclass instances with fresh defaults, discarding the caller's configurati...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None4e7a7296a3830877cf21a6ad2a972c9e618a48915e03966cf0c53eb08e5aad98
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/derek73/python-nameparser git https://github.com/derek73/python-nameparser.git
octolytics-dimension-user_id18306
octolytics-dimension-user_loginderek73
octolytics-dimension-repository_id18353524
octolytics-dimension-repository_nwoderek73/python-nameparser
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id18353524
octolytics-dimension-repository_network_root_nwoderek73/python-nameparser
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
release87685a1c739dbf97e95760413799bb0221799457
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/derek73/python-nameparser/pull/237/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fderek73%2Fpython-nameparser%2Fpull%2F237%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%2Fderek73%2Fpython-nameparser%2Fpull%2F237%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=derek73%2Fpython-nameparser
Reloadhttps://github.com/derek73/python-nameparser/pull/237/files
Reloadhttps://github.com/derek73/python-nameparser/pull/237/files
Reloadhttps://github.com/derek73/python-nameparser/pull/237/files
derek73 https://github.com/derek73
python-nameparserhttps://github.com/derek73/python-nameparser
Notifications https://github.com/login?return_to=%2Fderek73%2Fpython-nameparser
Fork 111 https://github.com/login?return_to=%2Fderek73%2Fpython-nameparser
Star 711 https://github.com/login?return_to=%2Fderek73%2Fpython-nameparser
Code https://github.com/derek73/python-nameparser
Issues 22 https://github.com/derek73/python-nameparser/issues
Pull requests 2 https://github.com/derek73/python-nameparser/pulls
Actions https://github.com/derek73/python-nameparser/actions
Projects https://github.com/derek73/python-nameparser/projects
Wiki https://github.com/derek73/python-nameparser/wiki
Security and quality 0 https://github.com/derek73/python-nameparser/security
Insights https://github.com/derek73/python-nameparser/pulse
Code https://github.com/derek73/python-nameparser
Issues https://github.com/derek73/python-nameparser/issues
Pull requests https://github.com/derek73/python-nameparser/pulls
Actions https://github.com/derek73/python-nameparser/actions
Projects https://github.com/derek73/python-nameparser/projects
Wiki https://github.com/derek73/python-nameparser/wiki
Security and quality https://github.com/derek73/python-nameparser/security
Insights https://github.com/derek73/python-nameparser/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fderek73%2Fpython-nameparser%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fderek73%2Fpython-nameparser%2Fissues%2Fnew%2Fchoose
derek73https://github.com/derek73
masterhttps://github.com/derek73/python-nameparser/tree/master
fix/issue-226-constants-subclasshttps://github.com/derek73/python-nameparser/tree/fix/issue-226-constants-subclass
Conversation 1 https://github.com/derek73/python-nameparser/pull/237
Commits 2 https://github.com/derek73/python-nameparser/pull/237/commits
Checks 8 https://github.com/derek73/python-nameparser/pull/237/checks
Files changed https://github.com/derek73/python-nameparser/pull/237/files
Please reload this pagehttps://github.com/derek73/python-nameparser/pull/237/files
Fix constants argument silently discarding Constants subclasses https://github.com/derek73/python-nameparser/pull/237/files#top
Show all changes 2 commits https://github.com/derek73/python-nameparser/pull/237/files
4097e7b Fix constants argument silently discarding Constants subclasses derek73 Jul 5, 2026 https://github.com/derek73/python-nameparser/pull/237/commits/4097e7bcf89bde3b1781148a41c2a89c43b29ccc
84b81cc Review follow-ups: class-not-instance hint, stale doc sweep derek73 Jul 5, 2026 https://github.com/derek73/python-nameparser/pull/237/commits/84b81cc9371f2270a28fa72b59bd31085a90b96a
Clear filters https://github.com/derek73/python-nameparser/pull/237/files
Please reload this pagehttps://github.com/derek73/python-nameparser/pull/237/files
Please reload this pagehttps://github.com/derek73/python-nameparser/pull/237/files
AGENTS.md https://github.com/derek73/python-nameparser/pull/237/files#diff-a54ff182c7e8acf56acfd6e4b9c3ff41e2c41a31c9b211b2deb9df75d9a478f9
customize.rst https://github.com/derek73/python-nameparser/pull/237/files#diff-b5794fa19aaf3385d170bfc3eda0fe44b41d23aac18feaf2b5993ad99df8c100
release_log.rst https://github.com/derek73/python-nameparser/pull/237/files#diff-3c065e5059f4ca46ff9ce2471af6f5a86086d0c517b8bc21ed9ef082943b3960
__init__.py https://github.com/derek73/python-nameparser/pull/237/files#diff-dcedfd4bdfcb3874407f561933a63d87851fb7640af137678ee1e18bc02089f7
parser.py https://github.com/derek73/python-nameparser/pull/237/files#diff-03c2f987f4d661012a7843bb797f32bcbbc5126415024e3dfc7255766a95d3fe
test_constants.py https://github.com/derek73/python-nameparser/pull/237/files#diff-85f35f24d7cc70f121d6ec00a1bcaa99af25d74a1621e0a610609fd1c40d7a3e
AGENTS.mdhttps://github.com/derek73/python-nameparser/pull/237/files#diff-a54ff182c7e8acf56acfd6e4b9c3ff41e2c41a31c9b211b2deb9df75d9a478f9
View file https://github.com/derek73/python-nameparser/blob/84b81cc9371f2270a28fa72b59bd31085a90b96a/AGENTS.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/derek73/python-nameparser/pull/237/{{ revealButtonHref }}
https://github.com/derek73/python-nameparser/pull/237/files#diff-a54ff182c7e8acf56acfd6e4b9c3ff41e2c41a31c9b211b2deb9df75d9a478f9
https://github.com/derek73/python-nameparser/pull/237/files#diff-a54ff182c7e8acf56acfd6e4b9c3ff41e2c41a31c9b211b2deb9df75d9a478f9
docs/customize.rsthttps://github.com/derek73/python-nameparser/pull/237/files#diff-b5794fa19aaf3385d170bfc3eda0fe44b41d23aac18feaf2b5993ad99df8c100
View file https://github.com/derek73/python-nameparser/blob/84b81cc9371f2270a28fa72b59bd31085a90b96a/docs/customize.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/derek73/python-nameparser/pull/237/{{ revealButtonHref }}
https://github.com/derek73/python-nameparser/pull/237/files#diff-b5794fa19aaf3385d170bfc3eda0fe44b41d23aac18feaf2b5993ad99df8c100
https://github.com/derek73/python-nameparser/pull/237/files#diff-b5794fa19aaf3385d170bfc3eda0fe44b41d23aac18feaf2b5993ad99df8c100
docs/release_log.rsthttps://github.com/derek73/python-nameparser/pull/237/files#diff-3c065e5059f4ca46ff9ce2471af6f5a86086d0c517b8bc21ed9ef082943b3960
View file https://github.com/derek73/python-nameparser/blob/84b81cc9371f2270a28fa72b59bd31085a90b96a/docs/release_log.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/derek73/python-nameparser/pull/237/{{ revealButtonHref }}
https://github.com/derek73/python-nameparser/pull/237/files#diff-3c065e5059f4ca46ff9ce2471af6f5a86086d0c517b8bc21ed9ef082943b3960
nameparser/config/__init__.pyhttps://github.com/derek73/python-nameparser/pull/237/files#diff-dcedfd4bdfcb3874407f561933a63d87851fb7640af137678ee1e18bc02089f7
View file https://github.com/derek73/python-nameparser/blob/84b81cc9371f2270a28fa72b59bd31085a90b96a/nameparser/config/__init__.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/derek73/python-nameparser/pull/237/{{ revealButtonHref }}
https://github.com/derek73/python-nameparser/pull/237/files#diff-dcedfd4bdfcb3874407f561933a63d87851fb7640af137678ee1e18bc02089f7
https://github.com/derek73/python-nameparser/pull/237/files#diff-dcedfd4bdfcb3874407f561933a63d87851fb7640af137678ee1e18bc02089f7
nameparser/parser.pyhttps://github.com/derek73/python-nameparser/pull/237/files#diff-03c2f987f4d661012a7843bb797f32bcbbc5126415024e3dfc7255766a95d3fe
View file https://github.com/derek73/python-nameparser/blob/84b81cc9371f2270a28fa72b59bd31085a90b96a/nameparser/parser.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/derek73/python-nameparser/pull/237/{{ revealButtonHref }}
https://github.com/derek73/python-nameparser/pull/237/files#diff-03c2f987f4d661012a7843bb797f32bcbbc5126415024e3dfc7255766a95d3fe
https://github.com/derek73/python-nameparser/pull/237/files#diff-03c2f987f4d661012a7843bb797f32bcbbc5126415024e3dfc7255766a95d3fe
https://github.com/derek73/python-nameparser/pull/237/files#diff-03c2f987f4d661012a7843bb797f32bcbbc5126415024e3dfc7255766a95d3fe
https://github.com/derek73/python-nameparser/pull/237/files#diff-03c2f987f4d661012a7843bb797f32bcbbc5126415024e3dfc7255766a95d3fe
https://github.com/derek73/python-nameparser/pull/237/files#diff-03c2f987f4d661012a7843bb797f32bcbbc5126415024e3dfc7255766a95d3fe
tests/test_constants.pyhttps://github.com/derek73/python-nameparser/pull/237/files#diff-85f35f24d7cc70f121d6ec00a1bcaa99af25d74a1621e0a610609fd1c40d7a3e
View file https://github.com/derek73/python-nameparser/blob/84b81cc9371f2270a28fa72b59bd31085a90b96a/tests/test_constants.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/derek73/python-nameparser/pull/237/{{ revealButtonHref }}
https://github.com/derek73/python-nameparser/pull/237/files#diff-85f35f24d7cc70f121d6ec00a1bcaa99af25d74a1621e0a610609fd1c40d7a3e
https://github.com/derek73/python-nameparser/pull/237/files#diff-85f35f24d7cc70f121d6ec00a1bcaa99af25d74a1621e0a610609fd1c40d7a3e
Please reload this pagehttps://github.com/derek73/python-nameparser/pull/237/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.