Title: SetManager.__contains__ is the lone non-normalizing membership check · Issue #244 · derek73/python-nameparser · GitHub
Open Graph Title: SetManager.__contains__ is the lone non-normalizing membership check · Issue #244 · derek73/python-nameparser
X Title: SetManager.__contains__ is the lone non-normalizing membership check · Issue #244 · derek73/python-nameparser
Description: After #238's follow-ups on PR #240, SetManager normalizes everywhere — add(), remove(), the constructor, and all set operators apply lc() (lowercase, strip leading/trailing periods). __contains__ is now the single exception: from namepar...
Open Graph Description: After #238's follow-ups on PR #240, SetManager normalizes everywhere — add(), remove(), the constructor, and all set operators apply lc() (lowercase, strip leading/trailing periods). __contains__ i...
X Description: After #238's follow-ups on PR #240, SetManager normalizes everywhere — add(), remove(), the constructor, and all set operators apply lc() (lowercase, strip leading/trailing periods). __contains...
Opengraph URL: https://github.com/derek73/python-nameparser/issues/244
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SetManager.__contains__ is the lone non-normalizing membership check","articleBody":"After #238's follow-ups on PR #240, `SetManager` normalizes everywhere — `add()`, `remove()`, the constructor, and all set operators apply `lc()` (lowercase, strip leading/trailing periods). `__contains__` is now the single exception:\n\n```python\nfrom nameparser.config import Constants\n\nc = Constants()\n'Dr.' in c.titles # False — raw membership\nc.titles.remove('Dr.') # removes 'dr' — normalized\nc.titles \u0026 ['Dr.'] # matches 'dr' — normalized\n```\n\nA user who checks `'Dr.' in c.titles`, sees `False`, and concludes their config never took effect is misled — every other operation on the same value succeeds.\n\nFix options: normalize `str` values in `__contains__` (`lc(value) in self.elements`; the parser's own `lc(piece) in ...` calls are unaffected since `lc` is idempotent), or document raw membership as intended. Normalizing seems right for consistency. Note the ABC comparison mixins (`__le__`, `__eq__`) route through `__contains__`/element iteration, so check those semantics while at it.\n\nFound by review of PR #240 — the asymmetry predates that PR (add/remove already normalized), but the PR widens it: seven operations normalize, one membership check doesn't.","author":{"url":"https://github.com/derek73","@type":"Person","name":"derek73"},"datePublished":"2026-07-06T01:51:10.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/244/python-nameparser/issues/244"}
| 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:71291925-7e59-78d6-7c15-32d07ab88944 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9DC6:28EA01:6A28:9173:6A55851F |
| html-safe-nonce | eb085996e4a825333a953b57bf92d323121cbda23153e6db13e35ad4247864fd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5REM2OjI4RUEwMTo2QTI4OjkxNzM6NkE1NTg1MUYiLCJ2aXNpdG9yX2lkIjoiMTEwNzI1MjE1NzA1OTc5NDIwNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 49a742e1a7b840204151d41bb013c40ac8d27eb4f11ccdc94862ab5856175457 |
| hovercard-subject-tag | issue:4815326930 |
| 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/244/issue_layout |
| twitter:image | https://opengraph.githubassets.com/aea56086add2aa52ec552c5fad1701c74906de2e867050217f5d65a029f22685/derek73/python-nameparser/issues/244 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/aea56086add2aa52ec552c5fad1701c74906de2e867050217f5d65a029f22685/derek73/python-nameparser/issues/244 |
| og:image:alt | After #238's follow-ups on PR #240, SetManager normalizes everywhere — add(), remove(), the constructor, and all set operators apply lc() (lowercase, strip leading/trailing periods). __contains__ i... |
| 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 | b5665c84831ed9ac4fb79519c16c9c5580ba8092fb8bb6e3e72972ec7197348e |
| 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 | 3215163789b3dc58dba97bd78a30c20c949f477f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width