Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ComplexNumber not Counter; fix change default #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/classes/test_class_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_class_objects():

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

class ComplexNumber:
Expand Down Expand Up @@ -52,9 +52,9 @@ def get_imaginary(self):
assert complex_number.real == 10
assert complex_number.get_real() == 10

# Let's change counter default value back.
ComplexNumber.real = 10
assert ComplexNumber.real == 10
# Let's change complex number default value back.
ComplexNumber.real = 0
assert ComplexNumber.real == 0

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