Skip to content

Commit cddb09f

Browse files
committed
docs: add maiden to usage.rst repr/as_dict examples (#22)
Closes the gap the final feature review flagged: repr() and as_dict() now always include maiden, but usage.rst's walkthrough examples predate that field and were never updated. Also corrects the as_dict() example's key order to match actual _members iteration order (was already stale/mismatched before this branch, unrelated to maiden -- fixed here since the line was already being touched). Verified via `sphinx-build -b doctest`: failure count for the whole docs/ tree drops from 26 to 21 with this change, and none of the remaining failures reference maiden -- they're pre-existing cross-example CONSTANTS state leaks already noted in AGENTS.md's doctest gotcha, unrelated to this feature.
1 parent 85600a6 commit cddb09f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

docs/usage.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Requires Python 3.10+.
4242
last: 'Velasquez y Garcia'
4343
suffix: 'Jr.'
4444
nickname: ''
45+
maiden: ''
4546
]>
4647
>>> name.middle = "Jason Alexander"
4748
>>> name.middle
@@ -54,15 +55,16 @@ Requires Python 3.10+.
5455
last: 'Velasquez y Garcia'
5556
suffix: 'Jr.'
5657
nickname: ''
58+
maiden: ''
5759
]>
5860
>>> name.middle = ["custom","values"]
5961
>>> name.middle
6062
'custom values'
6163
>>> name.full_name = 'Doe-Ray, Jonathan "John" A. Harris'
6264
>>> name.as_dict()
63-
{'last': 'Doe-Ray', 'suffix': '', 'title': '', 'middle': 'A. Harris', 'nickname': 'John', 'first': 'Jonathan'}
65+
{'title': '', 'first': 'Jonathan', 'middle': 'A. Harris', 'last': 'Doe-Ray', 'suffix': '', 'nickname': 'John', 'maiden': ''}
6466
>>> name.as_dict(False) # add False to hide keys with empty values
65-
{'middle': 'A. Harris', 'nickname': 'John', 'last': 'Doe-Ray', 'first': 'Jonathan'}
67+
{'first': 'Jonathan', 'middle': 'A. Harris', 'last': 'Doe-Ray', 'nickname': 'John'}
6668
>>> name = HumanName("Dr. Juan Q. Xavier de la Vega III")
6769
>>> name2 = HumanName("de la vega, dr. juan Q. xavier III")
6870
>>> name == name2
@@ -145,6 +147,7 @@ available from the nickname attribute.
145147
last: 'Smith'
146148
suffix: ''
147149
nickname: 'John'
150+
maiden: ''
148151
]>
149152

150153
Exception: content that looks like a suffix (a member of
@@ -166,6 +169,7 @@ written in parenthesis.
166169
last: 'Perkins'
167170
suffix: 'MBA'
168171
nickname: ''
172+
maiden: ''
169173
]>
170174

171175
A few suffix acronyms, listed in
@@ -186,6 +190,7 @@ reading in that ambiguous context:
186190
last: 'BRICKEN'
187191
suffix: ''
188192
nickname: 'JD'
193+
maiden: ''
189194
]>
190195

191196
Leading Period-Abbreviation Titles
@@ -211,6 +216,7 @@ word appearing after the first name is left as a middle name.
211216
last: 'Smith'
212217
suffix: ''
213218
nickname: ''
219+
maiden: ''
214220
]>
215221
>>> name = HumanName("J. Smith")
216222
>>> name.first

0 commit comments

Comments
 (0)