René's URL Explorer Experiment


Title: Remove empty_attribute_default; empty attributes always return '' · Issue #255 · derek73/python-nameparser · GitHub

Open Graph Title: Remove empty_attribute_default; empty attributes always return '' · Issue #255 · derek73/python-nameparser

X Title: Remove empty_attribute_default; empty attributes always return '' · Issue #255 · derek73/python-nameparser

Description: Summary 2.0 removes the empty_attribute_default config option entirely. Empty name attributes always return ''. Once None support goes (see below for why it must), the only legal value left is the default — a dial with one position isn't...

Open Graph Description: Summary 2.0 removes the empty_attribute_default config option entirely. Empty name attributes always return ''. Once None support goes (see below for why it must), the only legal value left is the ...

X Description: Summary 2.0 removes the empty_attribute_default config option entirely. Empty name attributes always return ''. Once None support goes (see below for why it must), the only legal value left...

Opengraph URL: https://github.com/derek73/python-nameparser/issues/255

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Remove empty_attribute_default; empty attributes always return ''","articleBody":"## Summary\n\n2.0 removes the `empty_attribute_default` config option entirely. Empty name attributes always return `''`. Once `None` support goes (see below for why it must), the only legal value left is the default — a dial with one position isn't configuration.\n\n## History: why it exists\n\nAdded in v0.3.15 (2016, pre-1.0) for #44: a user wanted `None` instead of `''` to store name components as database `NULL`s. The maintainer's first response was the one-liner that is now the migration path — \"you could do it easily too with something like `name.title or None`\" — and \"I don't have a strong preference.\" Making `None` the universal return broke the formatting tests, so a config option was added as a compromise. The first consequence arrived in the same thread: `str()` produced `'None John None Doe None (None)'`, patched in PR #45 with a `.replace(str(empty_attribute_default), '')` scrub that is still in `__str__` today.\n\n## What it has cost\n\n- Every `-\u003e str` annotation on the public API is false when the option is set to `None`; the attribute was deliberately left untyped in the mypy work (PR #250) because typing it honestly cascades `| None` through everything\n- The `\"J. None D.\"` initials bug, fixed in 1.3.0 — same laundering class\n- **Live data corruption** (#254): the PR #45 scrub can't distinguish an interpolated `None` from name text, so in None-mode `str(HumanName(\"Nonez Smith\"))` returns `'z Smith'` — the parse is correct and `__str__` strips the literal `None` out of the person's name\n\n## What removal deletes\n\nThe `or self.C.empty_attribute_default` tail on all seven attribute properties plus `surnames`/`given_names`/`last_base`/`last_prefixes` and `initials()`; the `__str__` scrub hack; the docs section; the test `type: ignore`s.\n\n## Removal mechanics (both learned from the 1.3.0 guard work)\n\n- **Tombstone, not deletion:** `empty_attribute_default` is a plain attribute, so naive removal makes `CONSTANTS.empty_attribute_default = None` a silent no-op — the accept-and-ignore failure family #241 exterminated. 2.0 keeps a property whose setter raises with the migration hint.\n- **Readers exist, not just writers:** the #44 thread advised asserting against `hn.C.empty_attribute_default` in downstream tests. Reads break loudly with the tombstone; migration is \"compare with `''` or truthiness.\"\n\n## Migration\n\n`hn.first or None` at the database boundary, or `{k: v or None for k, v in name.as_dict().items()}` for a whole record.\n\n## Bridge (1.4) — tracked in #263\n\n- [ ] `DeprecationWarning` on any assignment to `empty_attribute_default`\n- [ ] Ship the `__str__` mangling fix (#254) so None-mode users get correct output during their migration window\n\n","author":{"url":"https://github.com/derek73","@type":"Person","name":"derek73"},"datePublished":"2026-07-06T07:44:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/255/python-nameparser/issues/255"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ac422f81-da57-a2f8-23b4-f9e65d1263d9
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA71E:3AEA05:C470D3:10C770E:6A555F61
html-safe-nonce4e9ac235a21a516a281e72dc474c4f1e08bc47d66c29b75bb60b33a10d845c7e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzFFOjNBRUEwNTpDNDcwRDM6MTBDNzcwRTo2QTU1NUY2MSIsInZpc2l0b3JfaWQiOiI1NjQ5MDk3NjM0OTc3NTA1MTIyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac6c682e9a8a601c5599387a5e4102bd02938668db9ebe109e2791282c65be624a
hovercard-subject-tagissue:4817041778
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/derek73/python-nameparser/255/issue_layout
twitter:imagehttps://opengraph.githubassets.com/4c0db5d7726eb38dea925672f5acf1a64d84ab0ea2373b96148bf1a262636e61/derek73/python-nameparser/issues/255
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/4c0db5d7726eb38dea925672f5acf1a64d84ab0ea2373b96148bf1a262636e61/derek73/python-nameparser/issues/255
og:image:altSummary 2.0 removes the empty_attribute_default config option entirely. Empty name attributes always return ''. Once None support goes (see below for why it must), the only legal value left is the ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamederek73
hostnamegithub.com
expected-hostnamegithub.com
Noneb5665c84831ed9ac4fb79519c16c9c5580ba8092fb8bb6e3e72972ec7197348e
turbo-cache-controlno-preview
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release73595e82546ca2415571a2031890ab16ecb3001a
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/derek73/python-nameparser/issues/255#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fderek73%2Fpython-nameparser%2Fissues%2F255
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%2Fissues%2F255
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%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=derek73%2Fpython-nameparser
Reloadhttps://github.com/derek73/python-nameparser/issues/255
Reloadhttps://github.com/derek73/python-nameparser/issues/255
Reloadhttps://github.com/derek73/python-nameparser/issues/255
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
Remove empty_attribute_default; empty attributes always return ''https://github.com/derek73/python-nameparser/issues/255#top
https://github.com/derek73
breaking-changeBackwards-incompatible API changehttps://github.com/derek73/python-nameparser/issues?q=state%3Aopen%20label%3A%22breaking-change%22
enhancementhttps://github.com/derek73/python-nameparser/issues?q=state%3Aopen%20label%3A%22enhancement%22
v2.0https://github.com/derek73/python-nameparser/milestone/35
https://github.com/derek73
derek73https://github.com/derek73
on Jul 6, 2026https://github.com/derek73/python-nameparser/issues/255#issue-4817041778
#44https://github.com/derek73/python-nameparser/issues/44
#45https://github.com/derek73/python-nameparser/pull/45
Add tests/ to mypy scope; fix real type gaps it surfaces #250https://github.com/derek73/python-nameparser/pull/250
str() strips literal "None" from real names when empty_attribute_default is None #254https://github.com/derek73/python-nameparser/issues/254
remove default attribute from formatted string (#44) #45https://github.com/derek73/python-nameparser/pull/45
Non-descriptor Constants set attributes accept bare-string assignment; substring 'in' silently corrupts parsing #241https://github.com/derek73/python-nameparser/issues/241
Option to get None instead of empty string #44https://github.com/derek73/python-nameparser/issues/44
#263https://github.com/derek73/python-nameparser/issues/263
str() strips literal "None" from real names when empty_attribute_default is None #254https://github.com/derek73/python-nameparser/issues/254
derek73https://github.com/derek73
breaking-changeBackwards-incompatible API changehttps://github.com/derek73/python-nameparser/issues?q=state%3Aopen%20label%3A%22breaking-change%22
enhancementhttps://github.com/derek73/python-nameparser/issues?q=state%3Aopen%20label%3A%22enhancement%22
v2.0No due datehttps://github.com/derek73/python-nameparser/milestone/35
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.