Skip to content

Commit 13bc95b

Browse files
committed
get full_name should return current string output, not original name
1 parent e75cb81 commit 13bc95b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

nameparser/parser.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,8 @@ def is_an_initial(self, value):
363363

364364
@property
365365
def full_name(self):
366-
"""The name string to be parsed."""
367-
return self._full_name
366+
"""The string output of the HumanName instance."""
367+
return self.__str__()
368368

369369
@full_name.setter
370370
def full_name(self, value):

tests.py

+6
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ def test_assignment_to_full_name(self):
111111
self.m(hn.last, "Velasquez y Garcia", hn)
112112
self.m(hn.suffix, "III", hn)
113113

114+
def test_get_full_name_attribute_references_internal_lists(self):
115+
hn = HumanName("John Williams")
116+
hn.first_list = ["Larry"]
117+
self.m(hn.full_name, "Larry Williams", hn)
118+
119+
114120
def test_assignment_to_attribute(self):
115121
hn = HumanName("John A. Kenneth Doe, Jr.")
116122
hn.last = "de la Vega"

0 commit comments

Comments
 (0)