@@ -87,8 +87,8 @@ def test_simple_variable_bind_twice_to_same():
8787 variable = SimpleVariable ("test" )
8888 constant = Constant ("value" )
8989
90- variable .bind_to (constant )
91- variable .bind_to (constant , already_bound_ok = True )
90+ variable .bind (constant )
91+ variable .bind (constant , already_bound_ok = True )
9292
9393 assert variable .value == "value"
9494
@@ -97,7 +97,7 @@ def test_simple_variable_bind_to_constant():
9797 variable = SimpleVariable ("old" )
9898 constant = Constant ("new" )
9999
100- variable .bind_to (constant )
100+ variable .bind (constant )
101101
102102 assert variable .value == "new"
103103
@@ -106,7 +106,7 @@ def test_simple_variable_bind_to_simple_variable():
106106 variable1 = SimpleVariable (100 )
107107 variable2 = SimpleVariable (200 )
108108
109- variable1 .bind_to (variable2 )
109+ variable1 .bind (variable2 )
110110
111111 assert variable1 .value == 200
112112
@@ -116,19 +116,19 @@ def test_simple_variable_bind_already_bound_error():
116116 constant1 = Constant ("value1" )
117117 constant2 = Constant ("value2" )
118118
119- variable .bind_to (constant1 )
119+ variable .bind (constant1 )
120120
121121 with pytest .raises (ValueError ):
122- variable .bind_to (constant2 )
122+ variable .bind (constant2 )
123123
124124
125125def test_simple_variable_bind_already_bound_ok ():
126126 variable = SimpleVariable ("test" )
127127 constant1 = Constant ("value1" )
128128 constant2 = Constant ("value2" )
129129
130- variable .bind_to (constant1 )
131- variable .bind_to (constant2 , already_bound_ok = True )
130+ variable .bind (constant1 )
131+ variable .bind (constant2 , already_bound_ok = True )
132132
133133 assert variable .value == "value2"
134134
@@ -137,7 +137,7 @@ def test_simple_variable_change_after_unbind():
137137 variable = SimpleVariable ("initial" )
138138 constant = Constant ("bound_value" )
139139
140- variable .bind_to (constant )
140+ variable .bind (constant )
141141 variable .unbind ()
142142 variable .value = "after_unbind"
143143
@@ -148,7 +148,7 @@ def test_simple_variable_change_without_unbind_raises():
148148 variable = SimpleVariable ("initial" )
149149 constant = Constant ("bound_value" )
150150
151- variable .bind_to (constant )
151+ variable .bind (constant )
152152 with pytest .raises (ValueError ):
153153 variable .value = "after_unbind"
154154
@@ -157,7 +157,7 @@ def test_simple_variable_change_root_after_unbind():
157157 dependent = SimpleVariable ("dependent" )
158158 root = SimpleVariable ("root" )
159159
160- dependent .bind_to (root )
160+ dependent .bind (root )
161161 dependent .unbind ()
162162 root .value = "new_root_value"
163163 assert dependent .value == "root"
@@ -184,7 +184,7 @@ def test_simple_variable_bind_updates_value():
184184
185185 variable .observe (observer )
186186 constant = Constant (42 )
187- variable .bind_to (constant )
187+ variable .bind (constant )
188188
189189 observer .assert_called_once_with (42 )
190190
@@ -194,7 +194,7 @@ def test_simple_variable_bound_value_changes_propagate():
194194 variable2 = SimpleVariable ("initial" )
195195 observer = OneParameterObserver ()
196196
197- variable1 .bind_to (variable2 )
197+ variable1 .bind (variable2 )
198198 variable1 .observe (observer )
199199 variable2 .value = "propagated"
200200
@@ -214,14 +214,14 @@ def test_simple_variable_bind_to_itself():
214214 variable = SimpleVariable ("test" )
215215
216216 with pytest .raises (RecursionError ):
217- variable .bind_to (variable )
217+ variable .bind (variable )
218218
219219
220220def test_simple_variable_set_value_while_bound_raises ():
221221 variable = SimpleVariable ("initial" )
222222 constant = Constant ("constant" )
223223
224- variable .bind_to (constant )
224+ variable .bind (constant )
225225 with pytest .raises (ValueError ):
226226 variable .value = "manual_value"
227227
@@ -242,17 +242,17 @@ def test_simple_variable_rebind_after_unbind():
242242 constant1 = Constant ("first" )
243243 constant2 = Constant ("second" )
244244
245- variable .bind_to (constant1 )
245+ variable .bind (constant1 )
246246 variable .unbind ()
247- variable .bind_to (constant2 )
247+ variable .bind (constant2 )
248248
249249 assert variable .value == "second"
250250
251251
252252def test_bind_weak_reference_clears ():
253253 root_var = SimpleVariable ("root0" )
254254 dependent_var = SimpleVariable ("" )
255- dependent_var .bind_to (root_var , bind_weakly = True )
255+ dependent_var .bind (root_var , bind_weakly = True )
256256
257257 values = []
258258 dependent_var .observe (lambda value : values .append (value ))
@@ -268,7 +268,7 @@ def test_bind_weak_reference_clears():
268268def test_bind_strong_reference_stays ():
269269 root_var = SimpleVariable ("root0" )
270270 dependent_var = SimpleVariable ("" )
271- dependent_var .bind_to (root_var , bind_weakly = False )
271+ dependent_var .bind (root_var , bind_weakly = False )
272272
273273 values = []
274274 dependent_var .observe (lambda value : values .append (value ))
@@ -286,8 +286,8 @@ def test_daisy_chain_variables_weak_reference_stays():
286286 middle_var = SimpleVariable ("" )
287287 dependent_var = SimpleVariable ("" )
288288
289- middle_var .bind_to (root_var , bind_weakly = True )
290- dependent_var .bind_to (middle_var , bind_weakly = False )
289+ middle_var .bind (root_var , bind_weakly = True )
290+ dependent_var .bind (middle_var , bind_weakly = False )
291291
292292 values = []
293293 dependent_var .observe (lambda value : values .append (value ))
0 commit comments