-
Notifications
You must be signed in to change notification settings - Fork 0
/
types_objet.py
95 lines (93 loc) · 3.38 KB
/
types_objet.py
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
##class types(object):
## def entier(self, *args, **kwargs):
## return entier(*args, **kwargs)
## def flottant(self, *args, **kwargs):
## return flottant(*args, **kwargs)
## def texte(self, *args, **kwargs):
## return texte(*args, **kwargs)
## def liste(self, *args, **kwargs):
## return liste(*args, **kwargs)
## def liste_const(self, *args, **kwargs):
## return liste_const(*args, **kwargs)
## def dico(self, *args, **kwargs):
## return dico(*args, **kwargs)
## def complèxe(self, *args, **kwargs):
## return complèxe(self, *args, **kwargs)
## def types(self, *args, **kwargs):
## return types(self, *args, **kwargs)
## def groupe(self, *args, **kwargs):
## return groupe(*args, **kwargs)
## def groupe_const(self, *args, **kwargs):
## return groupe_const(*args, **kwargs)
## def octets(self, *args, **kwargs):
## return octets(self, *args, **kwargs)
## def liste_octets(self, *args, **kwargs):
## return liste_octets(*args, **kwargs)
##
##
##class entier(int):
## def entier(self, *args, **kwargs):
## return entier(*args, **kwargs)
##
##class flottant(float):
## def flottant(self, *args, **kwargs):
## return flottant(*args, **kwargs)
##
##class texte(str):
## def texte(self, *args, **kwargs):
## return texte(*args, **kwargs)
##
##class liste(list):
## def liste(self, *args, **kwargs):
## return liste(*args, **kwargs)
##
##class liste_const(tuple):
## def liste_const(self, *args, **kwargs):
## return liste_const(*args, **kwargs)
##
##class dico(dict):
## def dico(self, *args, **kwargs):
## return dico(*args, **kwargs)
##
##class complèxe(complex):
## def complèxe(self, *args, **kwargs):
## return complèxe(self, *args, **kwargs)
##
##class groupe(set):
## def groupe(self, *args, **kwargs):
## return groupe(*args, **kwargs)
##
##class groupe_const(frozenset):
## def groupe_const(self, *args, **kwargs):
## return groupe_const(*args, **kwargs)
##
##class octets(bytes):
## def octets(self, *args, **kwargs):
## return octets(self, *args, **kwargs)
##
##class liste_octets(bytearray):
## def liste_octets(self, *args, **kwargs):
## return liste_octets(*args, **kwargs)
try:
from mot_clef import replace
def add_types(liste_replace:list[replace]) -> list[replace]:
liste_replace.append(replace("str", "texte"))
liste_replace.append(replace("int", "entier"))
liste_replace.append(replace("float", "flottant"))
liste_replace.append(replace("complex", "complèxe"))
liste_replace.append(replace("list", "liste"))
liste_replace.append(replace("tuple", "liste_const"))
liste_replace.append(replace("range", "liste_continue"))
liste_replace.append(replace("dict", "dico"))
liste_replace.append(replace("set", "groupe"))
liste_replace.append(replace("frozenset", "groupe_const"))
liste_replace.append(replace("bool", "booléen"))
liste_replace.append(replace("bytes", "octets"))
liste_replace.append(replace("bytearray", "liste_octet"))
liste_replace.append(replace("memoryview", "vue_mémoire"))
return liste_replace
except ModuleNotFoundError:
def add_types(liste_replace:list) -> list:
import sys
print("Types non chargés", file=sys.stderr)
return liste_replace