Skip to content

Commit 833161c

Browse files
committed
'next_partner' should be aproperty
1 parent 54f4a9b commit 833161c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

contents/stable_marriage_problem/code/python/stable_marriage.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def __init__(self, name):
7979
self.pref_index = 0
8080
self._partner = None
8181

82+
@property
8283
def next_choice(self):
8384
"""Return the next person in the own preference list"""
8485
if self.pref_index >= len(self.preference):
@@ -88,7 +89,7 @@ def next_choice(self):
8889

8990
def propose_to_next(self):
9091
"""Propose to the next person in the own preference list"""
91-
person = self.next_choice()
92+
person = self.next_choice
9293
person.candidates.append(self)
9394
self.pref_index += 1
9495

0 commit comments

Comments
 (0)