Skip to content

Commit 3008b48

Browse files
derek73claude
andcommitted
Remove family/family_prefixes semantic aliases
They added no functionality beyond last_base/last_prefixes and cut against the library's positional (not semantic) attribute stance. Removed before v1.3.0 ships, so no deprecation needed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 2d41255 commit 3008b48

4 files changed

Lines changed: 1 addition & 23 deletions

File tree

docs/release_log.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Release Log
1919
- Fix spurious leading space in surnames and empty token in suffix list after ``capitalize()`` with an empty middle or suffix (#164)
2020
- Fix extra whitespace before punctuation in ``str()`` output when a ``string_format`` field is empty (closes #139)
2121
- Fix ``'apn aprn'`` split into separate ``suffix_acronyms`` entries so each is recognized independently (closes #155)
22-
- Add ``last_base``, ``last_prefixes`` (and ``_list`` variants) plus ``family`` / ``family_prefixes`` aliases for splitting last-name prefix particles (tussenvoegsels) from the core surname (#130, #132)
22+
- Add ``last_base``, ``last_prefixes`` (and ``_list`` variants) for splitting last-name prefix particles (tussenvoegsels) from the core surname (#130, #132)
2323
- Fix suffix boundary lookup for prefixed last names with a title before and after (e.g. ``"dr Vincent van Gogh dr"`` producing a corrupted middle name) (closes #100)
2424
- Add ``patronymic_name_order`` flag to ``Constants`` and ``HumanName`` for opt-in detection and reordering of Russian formal-order names (Surname GivenName Patronymic) (#85)
2525
- Add Turkic (Azerbaijani/Central-Asian) patronymic detection to ``patronymic_name_order``, rotating the reversed 4-token formal shape (``Surname GivenName PatronymicRoot Marker``, e.g. ``oglu``/``qizi``) into Western order (#185)

docs/usage.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ Requires Python 3.10+.
2525
'Vega'
2626
>>> name.last_prefixes
2727
'de la'
28-
>>> name.family
29-
'Vega'
30-
>>> name.family_prefixes
31-
'de la'
3228
>>> name.suffix
3329
'III'
3430
>>> name.surnames

nameparser/parser.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -530,16 +530,6 @@ def last_prefixes(self) -> str:
530530
"""
531531
return " ".join(self.last_prefixes_list) or self.C.empty_attribute_default
532532

533-
@property
534-
def family(self) -> str:
535-
"""Alias for :py:attr:`last_base`."""
536-
return self.last_base
537-
538-
@property
539-
def family_prefixes(self) -> str:
540-
"""Alias for :py:attr:`last_prefixes`."""
541-
return self.last_prefixes
542-
543533
# setter methods
544534

545535
def _set_list(self, attr: str, value: str | list[str] | None) -> None:

tests/test_prefixes.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -247,14 +247,6 @@ def test_all_particles_guard(self) -> None:
247247
self.m(hn.last_base, hn.last, hn)
248248
self.m(hn.last_prefixes, "", hn)
249249

250-
def test_alias_family_equals_last_base(self) -> None:
251-
hn = HumanName("Vincent van Gogh")
252-
self.m(hn.family, hn.last_base, hn)
253-
254-
def test_alias_family_prefixes_equals_last_prefixes(self) -> None:
255-
hn = HumanName("Vincent van Gogh")
256-
self.m(hn.family_prefixes, hn.last_prefixes, hn)
257-
258250
def test_da_silva_title_plus_prefix(self) -> None:
259251
hn = HumanName("Dra. Andréia da Silva")
260252
self.m(hn.last_base, "Silva", hn)

0 commit comments

Comments
 (0)