Skip to content

Commit f65ed13

Browse files
derek73claude
andcommitted
Drop the two util.py symbols that died with v1's parser
util.py was byte-identical to v1's, never touched by the rewrite. All three of its symbols served v1's parser.py, and two of them became orphans the moment that file was deleted at the M11 swap: - `log` backed the log.debug() calls throughout v1's parse; nothing logs any more. Its NullHandler guarded a Python 2 "no handlers could be found" warning that Python 3's lastResort handles. - `HumanNameAttributeT` typed cap_word(word, attribute) and cap_piece(...) -- hooks 2.0 deliberately removed as subclass extension points (#280). Keeping the parameter type of a removed hook is carrying debris. lc() stays: _config_shim uses it as v1's normalization, and it is genuinely v1-layer code, so util.py retires in 3.0 with the rest of that layer rather than early. Said so in a module docstring it did not have, including the one thing a reader is likeliest to get wrong -- that the 2.0 core does NOT use it (_lexicon._normalize strips to a fixed point where lc() strips once). Both names were importable, so this is technically a breaking change to an undocumented surface; pre-2.0 is when that is free. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 8838474 commit f65ed13

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

nameparser/util.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
import logging
2-
from typing import Literal
1+
"""v1 normalization, kept for the 1.x compatibility layer.
32
4-
# http://code.google.com/p/python-nameparser/issues/detail?id=10
5-
log = logging.getLogger('HumanName')
6-
log.addHandler(logging.NullHandler())
7-
8-
9-
HumanNameAttributeT = Literal['title', 'first', 'middle', 'last', 'suffix', 'nickname', 'surnames']
3+
Removed in 3.0 with the rest of that layer. The 2.0 core does NOT use
4+
this: :func:`nameparser._lexicon._normalize` is its fold, which strips
5+
edge periods to a fixed point where ``lc()`` strips once.
6+
"""
107

118

129
def lc(value: str) -> str:

0 commit comments

Comments
 (0)