Skip to content

Remove nameparser.config.regexes in 3.0? The parser has not read REGEXES since 2.0 #1008

Closed

Description

@derek73

nameparser.config.regexes is public, but the parser reads none of it. Its 19 REGEXES entries configured the v1 parser through CONSTANTS.regexes. Since 2.0, parsing is configured by named Policy fields, and the docs already say both halves:

  • docs/customize.rst: editing REGEXES "is not a supported override. The parser does not read REGEXES at all."
  • docs/migrate.rst: every regexes.* entry except bidi and emoji "has no 3.0 replacement". Those two became Policy(strip_bidi=...) and Policy(strip_emoji=...).

So the module configures nothing and describes nothing about how a name is parsed. The vocabulary modules beside it raise a related but separate question, in #1007.

What keeping it costs

Proposed

Remove nameparser/config/regexes.py in 3.0:

  • Rework test_regex_sync.py to pin each hand copy to the pipeline's copy directly (_render._ROMAN to _vocab._ROMAN, and so on). Entries already mapped to None there are unaffected.
  • Drop regexes.REGEXES from test_contracts.py's exempt mappings, and the module from docs/modules.rst's automodule list.
  • Add a row to migrate.rst's removals saying a caller who reused a pattern should copy it.
  • Update customize.rst's freeze paragraph, which then names CAPITALIZATION_EXCEPTIONS alone.
  • Reword the "Ported from v1 (nameparser/config/regexes.py ...)" provenance comments in _vocab.py, _render.py and _tokenize.py so they don't point at a file that no longer exists.

Open

Activity

  1. self-assigned this
    on Nov 3, 2026
  2. added
    breaking-change
    on Nov 3, 2026
  3. added this to the 3.0 milestone on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

breaking-changeenhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions