Skip to content

Issues with OOP #351

Description

@edoardob90
  • We should probably change "class attributes" to "instance attributes" in the error message of the __str__ and __repr__ exercise:

def validate_oop_str_method(solution_result):
assert hasattr(solution_result.__str__, "__closure__"), (
"Make sure that the class is properly implementing the __str__() method."
)
assert solution_result.__str__.__closure__ is None, (
"The __str__() method should be using the class attributes."
)
def validate_oop_repr_method(solution_result):
assert hasattr(solution_result.__repr__, "__closure__"), (
"Make sure that the class is properly implementing the __repr__() method."
)
assert solution_result.__repr__.__closure__ is None, (
"The __repr__() method should be using the class attributes."
)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions