-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDatatypes.py
More file actions
58 lines (50 loc) · 1.4 KB
/
Copy pathDatatypes.py
File metadata and controls
58 lines (50 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from datetime import datetime
class StrType:
def __init__(self, value, timestamp=None):
self.value = value
self.timestamp = timestamp
def __str__(self):
return str(self.value)
class NumType:
def __init__(self, value, timestamp=None):
self.value = float(value)
self.timestamp = timestamp
def __str__(self):
return str(self.value)
'''class ListType:
def __init__(self, value):
self.value = value
#def __list__(self):
def __str__(self):
result = []
for v in self.value:
result.append(v["value"])
return str(result)
#return list(result.value)
'''
class ListType:
def __init__(self, timestamp = None):
self.value = []
def __str__(self):
res = []
for element in self.value:
res.append(element.value)
return str(res)
class NullType:
def __init__(self, timestamp = None):
self.timestamp = timestamp
def __str__(self):
return "Null"
class BoolType:
def __init__(self, value, timestamp=None):
# bool(value)
self.value = value
self.timestamp = timestamp
def __str__(self):
return str(self.value)
class TimeType:
def __init__(self, value, timestamp=None):
self.value = value
self.timestamp = timestamp
def __str__(self):
return str(self.value)