Skip to content

Commit f3e5842

Browse files
authored
ComplexNumber not Counter; fix change default
1 parent 5e936a7 commit f3e5842

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/classes/test_class_objects.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def test_class_objects():
1717

1818
# ATTRIBUTE REFERENCES use the standard syntax used for all attribute references in
1919
# Python: obj.name. Valid attribute names are all the names that were in the class’s namespace
20-
# when the class object was created. For class MyCounter the following references are valid
20+
# when the class object was created. For class ComplexNumber the following references are valid
2121
# attribute references:
2222

2323
class ComplexNumber:
@@ -52,9 +52,9 @@ def get_imaginary(self):
5252
assert complex_number.real == 10
5353
assert complex_number.get_real() == 10
5454

55-
# Let's change counter default value back.
56-
ComplexNumber.real = 10
57-
assert ComplexNumber.real == 10
55+
# Let's change complex number default value back.
56+
ComplexNumber.real = 0
57+
assert ComplexNumber.real == 0
5858

5959
# The instantiation operation (“calling” a class object) creates an empty object. Many classes
6060
# like to create objects with instances customized to a specific initial state. Therefore a

0 commit comments

Comments
 (0)