@@ -108,6 +108,159 @@ protected List<? extends NodeFactory<? extends PythonBuiltinBaseNode>> getNodeFa
108
108
private static long getBuiltinTypeWeaklistoffset (PythonBuiltinClassType cls ) {
109
109
// @formatter:off
110
110
return switch (cls ) {
111
+ case PythonObject , // object
112
+ PInt , // int
113
+ Boolean , // bool
114
+ PByteArray , // bytearray
115
+ PBytes , // bytes
116
+ PList , // list
117
+ PNone , // NoneType
118
+ PNotImplemented , // NotImplementedType
119
+ PTraceback , // traceback
120
+ Super , // super
121
+ PRange , // range
122
+ PDict , // dict
123
+ PDictKeysView , // dict_keys
124
+ PDictValuesView , // dict_values
125
+ PDictItemsView , // dict_items
126
+ PDictReverseKeyIterator , // dict_reversekeyiterator
127
+ PDictReverseValueIterator , // dict_reversevalueiterator
128
+ PDictReverseItemIterator , // dict_reverseitemiterator
129
+ PString , // str
130
+ PSlice , // slice
131
+ PStaticmethod , // staticmethod
132
+ PComplex , // complex
133
+ PFloat , // float
134
+ PProperty , // property
135
+ PTuple , // tuple
136
+ PEnumerate , // enumerate
137
+ PReverseIterator , // reversed
138
+ PFrame , // frame
139
+ PMappingproxy , // mappingproxy
140
+ GetSetDescriptor , // getset_descriptor
141
+ WrapperDescriptor , // wrapper_descriptor
142
+ MethodWrapper , // method-wrapper
143
+ PEllipsis , // ellipsis
144
+ MemberDescriptor , // member_descriptor
145
+ PSimpleNamespace , // types.SimpleNamespace
146
+ Capsule , // PyCapsule
147
+ PCell , // cell
148
+ PInstancemethod , // instancemethod
149
+ PBuiltinClassMethod , // classmethod_descriptor
150
+ PBuiltinFunction , // method_descriptor
151
+ PSentinelIterator , // callable_iterator
152
+ PIterator , // iterator
153
+ PCoroutineWrapper , // coroutine_wrapper
154
+ PEncodingMap , // EncodingMap
155
+ PIntInfo , // sys.int_info
156
+ PBaseException , // BaseException
157
+ Exception , // Exception
158
+ TypeError , // TypeError
159
+ StopAsyncIteration , // StopAsyncIteration
160
+ StopIteration , // StopIteration
161
+ GeneratorExit , // GeneratorExit
162
+ SystemExit , // SystemExit
163
+ KeyboardInterrupt , // KeyboardInterrupt
164
+ ImportError , // ImportError
165
+ ModuleNotFoundError , // ModuleNotFoundError
166
+ OSError , // OSError
167
+ EOFError , // EOFError
168
+ RuntimeError , // RuntimeError
169
+ RecursionError , // RecursionError
170
+ NotImplementedError , // NotImplementedError
171
+ NameError , // NameError
172
+ UnboundLocalError , // UnboundLocalError
173
+ AttributeError , // AttributeError
174
+ SyntaxError , // SyntaxError
175
+ IndentationError , // IndentationError
176
+ TabError , // TabError
177
+ LookupError , // LookupError
178
+ IndexError , // IndexError
179
+ KeyError , // KeyError
180
+ ValueError , // ValueError
181
+ UnicodeError , // UnicodeError
182
+ UnicodeEncodeError , // UnicodeEncodeError
183
+ UnicodeDecodeError , // UnicodeDecodeError
184
+ UnicodeTranslateError , // UnicodeTranslateError
185
+ AssertionError , // AssertionError
186
+ ArithmeticError , // ArithmeticError
187
+ FloatingPointError , // FloatingPointError
188
+ OverflowError , // OverflowError
189
+ ZeroDivisionError , // ZeroDivisionError
190
+ SystemError , // SystemError
191
+ ReferenceError , // ReferenceError
192
+ MemoryError , // MemoryError
193
+ BufferError , // BufferError
194
+ Warning , // Warning
195
+ UserWarning , // UserWarning
196
+ DeprecationWarning , // DeprecationWarning
197
+ PendingDeprecationWarning , // PendingDeprecationWarning
198
+ SyntaxWarning , // SyntaxWarning
199
+ RuntimeWarning , // RuntimeWarning
200
+ FutureWarning , // FutureWarning
201
+ ImportWarning , // ImportWarning
202
+ UnicodeWarning , // UnicodeWarning
203
+ BytesWarning , // BytesWarning
204
+ ResourceWarning , // ResourceWarning
205
+ ConnectionError , // ConnectionError
206
+ BlockingIOError , // BlockingIOError
207
+ BrokenPipeError , // BrokenPipeError
208
+ ChildProcessError , // ChildProcessError
209
+ ConnectionAbortedError , // ConnectionAbortedError
210
+ ConnectionRefusedError , // ConnectionRefusedError
211
+ ConnectionResetError , // ConnectionResetError
212
+ FileExistsError , // FileExistsError
213
+ FileNotFoundError , // FileNotFoundError
214
+ IsADirectoryError , // IsADirectoryError
215
+ NotADirectoryError , // NotADirectoryError
216
+ InterruptedError , // InterruptedError
217
+ PermissionError , // PermissionError
218
+ ProcessLookupError , // ProcessLookupError
219
+ TimeoutError , // TimeoutError
220
+ PFloatInfo , // sys.float_info
221
+ PythonModuleDef , // moduledef
222
+ PHashInfo , // sys.hash_info
223
+ PVersionInfo , // sys.version_info
224
+ PFlags , // sys.flags
225
+ PThreadInfo , // sys.thread_info
226
+ PMap , // map
227
+ PZip , // zip
228
+ PClassmethod , // classmethod
229
+ PBytesIOBuf , // _io._BytesIOBuffer
230
+ PIncrementalNewlineDecoder , // _io.IncrementalNewlineDecoder
231
+ PStatResult , // os.stat_result
232
+ PStatvfsResult , // os.statvfs_result
233
+ PTerminalSize , // os.terminal_size
234
+ PScandirIterator , // posix.ScandirIterator
235
+ PDirEntry , // posix.DirEntry
236
+ PUnameResult , // posix.uname_result
237
+ PStructTime , // time.struct_time
238
+ PDictItemIterator , // dict_itemiterator
239
+ PDictKeyIterator , // dict_keyiterator
240
+ PDictValueIterator , // dict_valueiterator
241
+ PAccumulate , // itertools.accumulate
242
+ PCombinations , // itertools.combinations
243
+ PCombinationsWithReplacement , // itertools.combinations_with_replacement
244
+ PCycle , // itertools.cycle
245
+ PDropwhile , // itertools.dropwhile
246
+ PTakewhile , // itertools.takewhile
247
+ PIslice , // itertools.islice
248
+ PStarmap , // itertools.starmap
249
+ PChain , // itertools.chain
250
+ PCompress , // itertools.compress
251
+ PFilterfalse , // itertools.filterfalse
252
+ PCount , // itertools.count
253
+ PZipLongest , // itertools.zip_longest
254
+ PPermutations , // itertools.permutations
255
+ PProduct , // itertools.product
256
+ PRepeat , // itertools.repeat
257
+ PGroupBy , // itertools.groupby
258
+ PTeeDataObject , // itertools._tee_dataobject
259
+ PDefaultDict , // collections.defaultdict
260
+ PDequeIter , // _collections._deque_iterator
261
+ PDequeRevIter , // _collections._deque_reverse_iterator
262
+ PTupleGetter // _collections._tuplegetter
263
+ -> 0 ;
111
264
case PythonClass -> 368 ; // type
112
265
case PSet , // set
113
266
PFrozenSet // frozenset
@@ -143,7 +296,8 @@ private static long getBuiltinTypeWeaklistoffset(PythonBuiltinClassType cls) {
143
296
PBufferedRandom // _io.BufferedRandom
144
297
-> 144 ;
145
298
case PTextIOWrapper -> 176 ; // _io.TextIOWrapper
146
- default -> 0 ;
299
+
300
+ default -> -1 ; // unknown or not implemented
147
301
// @formatter:on
148
302
};
149
303
}
0 commit comments