Skip to content

Remove unneeded re.U/re.UNICODE flags#197

Merged
derek73 merged 1 commit into
masterfrom
remove-unneeded-re-unicode-flag
Jul 2, 2026
Merged

Remove unneeded re.U/re.UNICODE flags#197
derek73 merged 1 commit into
masterfrom
remove-unneeded-re-unicode-flag

Conversation

@derek73

@derek73 derek73 commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • re.U/re.UNICODE is a no-op in Python 3 since str patterns are already Unicode-aware by default (it only matters for bytes patterns, which this project doesn't use). It was a leftover from the Python 2 era.
  • Removed all re.U/re.UNICODE occurrences from nameparser/config/regexes.py and the test files that mirror those patterns (tests/test_python_api.py, tests/test_nicknames.py, tests/test_constants.py).
  • No behavior change intended.

Test plan

  • python3 -m pytest -q — 1074 passed, 4 skipped, 22 xfailed (same as before the change)

🤖 Generated with Claude Code

Python 2 support was dropped, and in Python 3 str patterns are
Unicode-aware by default, making re.U/re.UNICODE a no-op. Strip it
from the compiled regexes in config and the tests that mirror them.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@derek73 derek73 self-assigned this Jul 2, 2026
@derek73 derek73 added this to the v1.3.0 milestone Jul 2, 2026
@derek73 derek73 merged commit 01719f2 into master Jul 2, 2026
8 checks passed
@derek73 derek73 deleted the remove-unneeded-re-unicode-flag branch July 2, 2026 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant