Skip to content

Commit be65195

Browse files
committed
docs: fix remaining stale repr()/slice examples missing maiden
Six repr() examples in customize.rst (Hon Solo x2, dean title x3, the suffix-attribute-list example) never got the maiden: '' line every real HumanName.__repr__() now emits -- these predate the maiden field and are unrelated to the nickname-delimiter sections this feature actually touched, so they were missed. Also fixes usage.rst's name[1:-2] slice example, which needed to become name[1:-3] once _members grew by one (the corresponding test_python_api.py::test_slice update was already made in this branch; the doc example was not). Verified via sphinx-build -b doctest: total failure count across docs/ drops from 21 (after the earlier usage.rst-only fix) to 15, with no remaining maiden-related mismatches. The rest are pre-existing cross-example CONSTANTS state leaks already documented in AGENTS.md's doctest gotcha, unrelated to this change. Found by review agents auditing PR #199.
1 parent 7b14aa9 commit be65195

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

docs/customize.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ constant so that "Hon" can be parsed as a first name.
327327
last: 'Solo'
328328
suffix: ''
329329
nickname: ''
330+
maiden: ''
330331
]>
331332
>>> from nameparser.config import CONSTANTS
332333
>>> CONSTANTS.titles.remove('hon')
@@ -340,6 +341,7 @@ constant so that "Hon" can be parsed as a first name.
340341
last: 'Solo'
341342
suffix: ''
342343
nickname: ''
344+
maiden: ''
343345
]>
344346

345347

@@ -380,6 +382,7 @@ making them lower case and removing periods.
380382
last: 'Johns'
381383
suffix: ''
382384
nickname: ''
385+
maiden: ''
383386
]>
384387

385388

@@ -407,6 +410,7 @@ the config on one instance could modify the behavior of another instance.
407410
last: 'Johns'
408411
suffix: ''
409412
nickname: ''
413+
maiden: ''
410414
]>
411415

412416

@@ -434,6 +438,7 @@ reference to the module-level config values with the behavior described above.
434438
last: 'Johns'
435439
suffix: ''
436440
nickname: ''
441+
maiden: ''
437442
]>
438443
>>> other_instance.has_own_config
439444
True
@@ -505,6 +510,7 @@ directly to the attribute.
505510
last: 'Doe'
506511
suffix: 'Md.'
507512
nickname: ''
513+
maiden: ''
508514
]>
509515

510516

docs/usage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Requires Python 3.10+.
7373
5
7474
>>> list(name)
7575
['Dr.', 'Juan', 'Q. Xavier', 'de la Vega', 'III']
76-
>>> name[1:-2]
76+
>>> name[1:-3]
7777
['Juan', 'Q. Xavier', 'de la Vega']
7878

7979

0 commit comments

Comments
 (0)