-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathoperator.py
More file actions
157 lines (57 loc) · 1.4 KB
/
operator.py
File metadata and controls
157 lines (57 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# COMPARISION
def lt(a,b):return a < b
def le(a,b):return a <= b
def eq(a,b):return a == b
def ne(a,b):return a != b
def ge(a,b):return a >= b
def gt(a,b):return a > b
# MATH AND LOGIC
def not_(obj):return not obj
def truth(obj):return bool(obj)
def is_(a,b):return a is b
def is_not(a,b):return a is not b
abs = abs
def add(a,b):return a + b
def and_(a,b):return a & b
def floordiv(a,b):return a // b
def index(a):return int(a)
def inv(obj):return ~obj
def lshift(a,b):return a << b
def mod(a,b):return a % b
def mul(a,b):return a * b
def neg(obj):return -obj
def or_(a,b):return a | b
def pos(obj):return +obj
def pow(a,b):return a ** b
def rshift(a,b):return a >> b
def sub(a,b):return a - b
def truediv(a,b):return a / b
def xor(a,b):return a ^ b
# SEQUENCES
def concat(a,b):return a + b
def contains(a,b):return b in a
def countOf(a,b):return a.count(b)
def delitem(a,b):
del a[b]
def getitem(a,b):
return a[b]
def indexOf(a,b):
if type(a) is str:return a.find(b)
else:return a.index(b)
def setitem(a,b,c):
c[b] = a
# INPLACE
def iadd(a,b): a+=b
def iand(a,b): a&=b
def iconcat(a,b): a+=b
def ifloordiv(a,b): a//=b
def ilshift(a,b): a<<=b
def imod(a,b): a%=b
def imul(a,b): a*=b
def ior(a,b): a|=b
def ipow(a,b): a**=b
def irshift(a,b): a>>=b
def isub(a,b): a-=b
def itruediv(a,b): a/=b
def ixor(a,b): a^=b
b = [4,8,7,6,5]