Skip to content

Commit

Permalink
model.datatypes: fix bytes copy issue for Date class
Browse files Browse the repository at this point in the history
  • Loading branch information
JGrothoff committed Sep 16, 2024
1 parent 5777e22 commit b00a8a7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions basyx/aas/model/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,17 @@ def __eq__(self, other: object) -> bool:
other_tzinfo = other.tzinfo if hasattr(other, 'tzinfo') else None # type: ignore
return datetime.date.__eq__(self, other) and self.tzinfo == other_tzinfo

def __copy__(self):
cls = self.__class__
result = cls.__new__(cls, self.year, self.month, self.day, self.tzinfo)
return result

def __deepcopy__(self, memo):
cls = self.__class__
result = cls.__new__(cls, self.year, self.month, self.day, self.tzinfo)
memo[id(self)] = result
return result

# TODO override comparsion operators
# TODO add into_datetime function
# TODO add includes(:DateTime) -> bool function
Expand Down

0 comments on commit b00a8a7

Please sign in to comment.