Title: Constants(titles='dr') silently shreds a bare string into characters · Issue #238 · derek73/python-nameparser · GitHub
Open Graph Title: Constants(titles='dr') silently shreds a bare string into characters · Issue #238 · derek73/python-nameparser
X Title: Constants(titles='dr') silently shreds a bare string into characters · Issue #238 · derek73/python-nameparser
Description: Every Iterable[str] parameter on Constants.__init__ accepts a bare str, which is an iterable — of characters. SetManager.__init__ (config/init.py, self.elements = set(elements)) then builds a set of single characters, silently replacing ...
Open Graph Description: Every Iterable[str] parameter on Constants.__init__ accepts a bare str, which is an iterable — of characters. SetManager.__init__ (config/init.py, self.elements = set(elements)) then builds a set o...
X Description: Every Iterable[str] parameter on Constants.__init__ accepts a bare str, which is an iterable — of characters. SetManager.__init__ (config/init.py, self.elements = set(elements)) then builds a set o...
Opengraph URL: https://github.com/derek73/python-nameparser/issues/238
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Constants(titles='dr') silently shreds a bare string into characters","articleBody":"Every `Iterable[str]` parameter on `Constants.__init__` accepts a bare `str`, which *is* an iterable — of characters. `SetManager.__init__` (config/__init__.py, `self.elements = set(elements)`) then builds a set of single characters, silently replacing the entire default set.\n\nRepro:\n\n```python\nfrom nameparser import HumanName\nfrom nameparser.config import Constants\n\nc = Constants(titles='dr')\nc.titles # SetManager({'d', 'r'}) — 600+ defaults gone\nHumanName('Dr John Smith', constants=c)\n# title='', first='Dr', last='Smith' — silently wrong, no error anywhere\n```\n\nThe same applies to all SetManager-backed keyword arguments. This is the same pattern family as #226: caller hands in configuration, the library silently destroys the intent. Debugging it later means diffing large constant sets.\n\nFix: reject `str`/`bytes` in `SetManager.__init__` (or at the `Constants.__init__` boundary) with a `TypeError` suggesting the fix, e.g. ``expected an iterable of strings, got a single string — wrap it: ['dr']``.\n\nFound by review of PR #237 — pre-existing, unrelated to that change.","author":{"url":"https://github.com/derek73","@type":"Person","name":"derek73"},"datePublished":"2026-07-06T00:49:28.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/238/python-nameparser/issues/238"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6677fb9f-92e0-53c4-f2fd-e6c02ae69421 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8D94:2BF803:2D07215:410196F:6A551C80 |
| html-safe-nonce | 0d4481a133027bb3f48f27e4ce1dab66f7ff9623c35b4b5c4d39738f62beac85 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RDk0OjJCRjgwMzoyRDA3MjE1OjQxMDE5NkY6NkE1NTFDODAiLCJ2aXNpdG9yX2lkIjoiNDcxMTUxOTI4MzcxNjYyNzU4NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 82710174aa79ad37d210215b030450bdbc82c77658163bee7c522b218f84e024 |
| hovercard-subject-tag | issue:4815114499 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/derek73/python-nameparser/238/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e49de6230ab654373962a1cd2f1c758d91993d5ece3eef77f05e9d74864c8c23/derek73/python-nameparser/issues/238 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e49de6230ab654373962a1cd2f1c758d91993d5ece3eef77f05e9d74864c8c23/derek73/python-nameparser/issues/238 |
| og:image:alt | Every Iterable[str] parameter on Constants.__init__ accepts a bare str, which is an iterable — of characters. SetManager.__init__ (config/init.py, self.elements = set(elements)) then builds a set o... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | derek73 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 682d273eacb2ac51680c6eb9c0b270f029f7ce74c32090f319083c34497e28a5 |
| turbo-cache-control | no-preview |
| go-import | github.com/derek73/python-nameparser git https://github.com/derek73/python-nameparser.git |
| octolytics-dimension-user_id | 18306 |
| octolytics-dimension-user_login | derek73 |
| octolytics-dimension-repository_id | 18353524 |
| octolytics-dimension-repository_nwo | derek73/python-nameparser |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 18353524 |
| octolytics-dimension-repository_network_root_nwo | derek73/python-nameparser |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3b6d37c6470adadff4194742daaab9a817cc4980 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width