You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
parse_pieces() and join_on_conjunctions() derived new lookup entries
while parsing (period-joined titles/suffixes like "Lt.Gov.",
conjunction-joined pieces like "Mr. and Mrs." and "von und zu") and
add()ed them directly to self.C — by default the shared module-level
CONSTANTS singleton. Parsing one name therefore permanently changed how
every later name in the process parsed: results depended on input
order, were not reproducible across runs, and concurrent parsing raced
on the shared sets. It also churned the suffixes_prefixes_titles cache,
which invalidated on every such add().
The derivations are only needed within the parse that produced them, so
track them in per-instance _derived_* sets that the is_title /
is_suffix / is_conjunction / is_prefix / is_rootname predicates consult
alongside self.C, and reset them at the start of each parse_full_name()
run. Parse results are unchanged (each parse re-derives its own
entries); the config is now read-only during parsing.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/release_log.rst
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
Release Log
2
2
===========
3
3
* 1.3.0 - Unreleased
4
+
- Fix parsing writing back into the ``Constants`` it reads (usually the shared module-level ``CONSTANTS``): pieces derived while parsing a name — period-joined titles/suffixes like ``"Lt.Gov."`` and conjunction-joined pieces like ``"Mr. and Mrs."`` or ``"von und zu"`` — are now tracked per parse instead of being permanently ``add()``-ed to the config, so parse results no longer depend on which names were parsed earlier in the process and parsing no longer mutates shared state across threads
4
5
- Remove the vestigial ``unparsable`` attribute: the guard that was meant to set it has been unreachable since 2013 (v0.2.9), so it has reported ``False`` for every parsed name for over a decade; check ``len(name) == 0`` to detect an empty parse
5
6
- Fix ``__hash__`` to lowercase the name like ``__eq__`` does, so equal ``HumanName`` instances hash equal and behave correctly in sets and dicts
6
7
- Fix ``initials()`` emitting a stray empty initial (e.g. ``"J. . V."``) -- or raising ``TypeError`` when ``empty_attribute_default`` is ``None`` -- for name parts with no initialable words, e.g. a prefix-only middle name like ``"de la"``
0 commit comments