Debian Codegraph @

test/completion/types.py

raw symbols SCIP
1 # -----------------
2 # non array
3 # -----------------
4
5 # python >= 3.12
6 #? ['imag']
7 int.imag
8
9 #? ['is_integer']
10 int.is_integer
11
12 #? ['is_integer']
13 float.is_int
14
15 #? ['is_integer']
16 1.0.is_integer
17
18 #? ['upper']
19 "".upper
20
21 #? ['upper']
22 r"".upper
23
24 # strangely this didn't work, because the = is used for assignments
25 #? ['upper']
26 "=".upper
27 a = "="
28 #? ['upper']
29 a.upper
30
31
32 # -----------------
33 # lists
34 # -----------------
35 arr = []
36 #? ['append']
37 arr.app
38
39 #? ['append']
40 list().app
41 #? ['append']
42 [].append
43
44 arr2 = [1,2,3]
45 #? ['append']
46 arr2.app
47
48 #? int()
49 arr.count(1)
50
51 x = []
52 #?
53 x.pop()
54 x = [3]
55 #? int()
56 x.pop()
57 x = []
58 x.append(1.0)
59 #? float()
60 x.pop()
61
62 # -----------------
63 # dicts
64 # -----------------
65 dic = {}
66
67 #? ['copy', 'clear']
68 dic.c
69
70 dic2 = dict(a=1, b=2)
71 #? ['pop', 'popitem']
72 dic2.p
73 #? ['popitem']
74 {}.popitem
75
76 dic2 = {'asdf': 3}
77 #? ['popitem']
78 dic2.popitem
79
80 #? int()
81 dic2['asdf']
82
83 d = {'a': 3, 1.0: list}
84
85 #? int() list
86 d.values()[0]
87 ##? int() list
88 dict(d).values()[0]
89
90 #? str()
91 d.items()[0][0]
92 #? int()
93 d.items()[0][1]
94
95 (a, b), = {a:1 for a in [1.0]}.items()
96 #? float()
97 a
98 #? int()
99 b
100
101 # -----------------
102 # tuples
103 # -----------------
104 tup = ('',2)
105
106 #? ['count']
107 tup.c
108
109 tup2 = tuple()
110 #? ['index']
111 tup2.i
112 #? ['index']
113 ().i
114
115 tup3 = 1,""
116 #? ['index']
117 tup3.index
118
119 tup4 = 1,""
120 #? ['index']
121 tup4.index
122
123 # -----------------
124 # set
125 # -----------------
126 set_t = {1,2}
127
128 #? ['clear', 'copy']
129 set_t.c
130
131 set_t2 = set()
132
133 #? ['clear', 'copy']
134 set_t2.c
135
136 # -----------------
137 # pep 448 unpacking generalizations
138 # -----------------
139
140 d = {'a': 3}
141 dc = {v: 3 for v in ['a']}
142
143 #? dict()
144 {**d}
145
146 #? dict()
147 {**dc}
148
149 #? str()
150 {**d, "b": "b"}["b"]
151
152 #? str()
153 {**dc, "b": "b"}["b"]
154
155 # Should resolve to int() but jedi is not smart enough yet
156 # Here to make sure it doesn't result in crash though
157 #?
158 {**d}["a"]
159
160 # Should resolve to int() but jedi is not smart enough yet
161 # Here to make sure it doesn't result in crash though
162 #?
163 {**dc}["a"]
164
165 s = {1, 2, 3}
166
167 #? set()
168 {*s}
169
170 #? set()
171 {*s, 4, *s}
172
173 s = {1, 2, 3}
174 # Should resolve to int() but jedi is not smart enough yet
175 # Here to make sure it doesn't result in crash though
176 #?
177 {*s}.pop()
178
179 #? int()
180 {*s, 4}.pop()
181
182 # Should resolve to int() but jedi is not smart enough yet
183 # Here to make sure it doesn't result in crash though
184 #?
185 [*s][0]
186
187 #? int()
188 [*s, 4][0]