Spaces:
Sleeping
Sleeping
Download model/Professor.py from garizz/class-scheduling: direct link, hf CLI and curl.
- Browser
- Download file 746 Bytes
-
https://huggingface.co/spaces/garizz/class-scheduling/resolve/main/model/Professor.py
- Command line
-
hf download hf://spaces/garizz/class-scheduling/model/Professor.py
-
curl -L -o Professor.py https://huggingface.co/spaces/garizz/class-scheduling/resolve/main/model/Professor.py
746 Bytes
| # Stores data about professor | |
| class Professor: | |
| # Initializes professor data | |
| def __init__(self, id, name): | |
| self.Id = id | |
| self.Name = name | |
| self.CourseClasses = [] | |
| # Bind professor to course | |
| def addCourseClass(self, courseClass): | |
| self.CourseClasses.append(courseClass) | |
| def __hash__(self): | |
| return hash(self.Id) | |
| # Compares ID's of two objects which represent professors | |
| def __eq__(self, other): | |
| if not isinstance(other, self.__class__): | |
| return False | |
| return hash(self) == hash(other) | |
| def __ne__(self, other): | |
| # Not strictly necessary, but to avoid having both x==y and x!=y | |
| # True at the same time | |
| return not (self == other) | |