From 18d6f5ebfb4de87307e02ab1117ff2365f13003d Mon Sep 17 00:00:00 2001 From: Salvo 'LtWorf' Tomaselli Date: Wed, 19 Aug 2020 10:49:54 +0200 Subject: [PATCH] Remove add and sub from Rdate They were not symmetrical, better to remove them. --- CHANGELOG | 1 + relational/rtypes.py | 7 ------- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 5af3e32..29cd016 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,5 @@ 3.0 +- Dates can no longer be added or subtracted - Types are now inferred by column, no longer by cell - Relations now use frozenset internally and are immutable - Refactored parser to use better typing diff --git a/relational/rtypes.py b/relational/rtypes.py index 80b3373..26914dc 100644 --- a/relational/rtypes.py +++ b/relational/rtypes.py @@ -88,10 +88,6 @@ class Rdate: def __str__(self): return self.intdate.__str__() - def __add__(self, days): - res = self.intdate + datetime.timedelta(days) - return Rdate(res.__str__()) - def __eq__(self, other): if not isinstance(other, Rdate): return False @@ -109,9 +105,6 @@ class Rdate: def __lt__(self, other): return self.intdate < other.intdate - def __sub__(self, other): - return (self.intdate - other.intdate).days - def is_valid_relation_name(name: str) -> bool: '''Checks if a name is valid for a relation.