Remove add and sub from Rdate
They were not symmetrical, better to remove them.
This commit is contained in:
parent
4dc7f131f3
commit
18d6f5ebfb
@ -1,4 +1,5 @@
|
|||||||
3.0
|
3.0
|
||||||
|
- Dates can no longer be added or subtracted
|
||||||
- Types are now inferred by column, no longer by cell
|
- Types are now inferred by column, no longer by cell
|
||||||
- Relations now use frozenset internally and are immutable
|
- Relations now use frozenset internally and are immutable
|
||||||
- Refactored parser to use better typing
|
- Refactored parser to use better typing
|
||||||
|
@ -88,10 +88,6 @@ class Rdate:
|
|||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.intdate.__str__()
|
return self.intdate.__str__()
|
||||||
|
|
||||||
def __add__(self, days):
|
|
||||||
res = self.intdate + datetime.timedelta(days)
|
|
||||||
return Rdate(res.__str__())
|
|
||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
if not isinstance(other, Rdate):
|
if not isinstance(other, Rdate):
|
||||||
return False
|
return False
|
||||||
@ -109,9 +105,6 @@ class Rdate:
|
|||||||
def __lt__(self, other):
|
def __lt__(self, other):
|
||||||
return self.intdate < other.intdate
|
return self.intdate < other.intdate
|
||||||
|
|
||||||
def __sub__(self, other):
|
|
||||||
return (self.intdate - other.intdate).days
|
|
||||||
|
|
||||||
|
|
||||||
def is_valid_relation_name(name: str) -> bool:
|
def is_valid_relation_name(name: str) -> bool:
|
||||||
'''Checks if a name is valid for a relation.
|
'''Checks if a name is valid for a relation.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user