-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasicClasses.py
More file actions
45 lines (29 loc) · 732 Bytes
/
Copy pathBasicClasses.py
File metadata and controls
45 lines (29 loc) · 732 Bytes
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
class Object(object):
def abort(self):
exit()
def type_name(self):
return Stringg(str(self.__class__))
def copy(self):
return self.copy()
class Stringg(Object, str):
def __new__(cls, content):
return super().__new__(cls, content.strip('"').replace('\\n','\n'))
def length(self):
return Int(len(self))
def concat(self, s):
return Stringg(self + s)
def substr(self, i, l):
return Stringg(self[i:i+l])
class IO(Object):
def out_string(self, x):
print(x, end='')
def out_int(self, x):
print(x, end='')
def in_string(self):
return Stringg(input())
def in_int(self):
return Int(int(input()))
class Int(Object, int):
pass
class Bool(Object, int):
pass