objective-lol 0.0.1__cp312-cp312-macosx_10_9_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
objective_lol/go.py ADDED
@@ -0,0 +1,1852 @@
1
+
2
+ # python wrapper for package go within overall package api
3
+ # This is what you import to use the package.
4
+ # File is generated by gopy. Do not edit.
5
+ # gopy build -no-make -dynamic-link=True -symbols=False -output /Users/runner/work/objective-lol/objective-lol/python/build/lib.macosx-10.9-x86_64-cpython-312/objective_lol --vm /Users/runner/work/objective-lol/objective-lol/python/.toolchain/python/python-3.12.11/bin/python3 .
6
+
7
+ # the following is required to enable dlopen to open the _go.so file
8
+ import os,sys,inspect,collections
9
+ try:
10
+ import collections.abc as _collections_abc
11
+ except ImportError:
12
+ _collections_abc = collections
13
+
14
+ cwd = os.getcwd()
15
+ currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
16
+ os.chdir(currentdir)
17
+ from . import _api
18
+
19
+ os.chdir(cwd)
20
+
21
+ # to use this code in your end-user python file, import it as follows:
22
+ # from api import go
23
+ # and then refer to everything using go. prefix
24
+ # packages imported by this package listed below:
25
+
26
+
27
+ import collections
28
+ try:
29
+ import collections.abc as _collections_abc
30
+ except ImportError:
31
+ _collections_abc = collections
32
+
33
+ class GoClass(object):
34
+ """GoClass is the base class for all GoPy wrapper classes"""
35
+ def __init__(self):
36
+ self.handle = 0
37
+
38
+ # use go.nil for nil pointers
39
+ nil = GoClass()
40
+
41
+ # need to explicitly initialize it
42
+ def main():
43
+ global nil
44
+ nil = GoClass()
45
+
46
+ main()
47
+
48
+ def Init():
49
+ """calls the GoPyInit function, which runs the 'main' code string that was passed using -main arg to gopy"""
50
+ _api.GoPyInit()
51
+
52
+
53
+
54
+
55
+ # ---- Types ---
56
+
57
+ # Python type for slice []bool
58
+ class Slice_bool(GoClass):
59
+ """"""
60
+ def __init__(self, *args, **kwargs):
61
+ """
62
+ handle=A Go-side object is always initialized with an explicit handle=arg
63
+ otherwise parameter is a python list that we copy from
64
+ """
65
+ self.index = 0
66
+ if len(kwargs) == 1 and 'handle' in kwargs:
67
+ self.handle = kwargs['handle']
68
+ _api.IncRef(self.handle)
69
+ elif len(args) == 1 and isinstance(args[0], GoClass):
70
+ self.handle = args[0].handle
71
+ _api.IncRef(self.handle)
72
+ else:
73
+ self.handle = _api.Slice_bool_CTor()
74
+ _api.IncRef(self.handle)
75
+ if len(args) > 0:
76
+ if not isinstance(args[0], _collections_abc.Iterable):
77
+ raise TypeError('Slice_bool.__init__ takes a sequence as argument')
78
+ for elt in args[0]:
79
+ self.append(elt)
80
+ def __del__(self):
81
+ _api.DecRef(self.handle)
82
+ def __str__(self):
83
+ s = 'go.Slice_bool len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
84
+ if len(self) < 120:
85
+ s += ', '.join(map(str, self)) + ']'
86
+ return s
87
+ def __repr__(self):
88
+ return 'go.Slice_bool([' + ', '.join(map(str, self)) + '])'
89
+ def __len__(self):
90
+ return _api.Slice_bool_len(self.handle)
91
+ def __getitem__(self, key):
92
+ if isinstance(key, slice):
93
+ if key.step == None or key.step == 1:
94
+ st = key.start
95
+ ed = key.stop
96
+ if st == None:
97
+ st = 0
98
+ if ed == None:
99
+ ed = _api.Slice_bool_len(self.handle)
100
+ return Slice_bool(handle=_api.Slice_bool_subslice(self.handle, st, ed))
101
+ return [self[ii] for ii in range(*key.indices(len(self)))]
102
+ elif isinstance(key, int):
103
+ if key < 0:
104
+ key += len(self)
105
+ if key < 0 or key >= len(self):
106
+ raise IndexError('slice index out of range')
107
+ return _api.Slice_bool_elem(self.handle, key)
108
+ else:
109
+ raise TypeError('slice index invalid type')
110
+ def __setitem__(self, idx, value):
111
+ if idx < 0:
112
+ idx += len(self)
113
+ if idx < len(self):
114
+ _api.Slice_bool_set(self.handle, idx, value)
115
+ return
116
+ raise IndexError('slice index out of range')
117
+ def __iadd__(self, value):
118
+ if not isinstance(value, _collections_abc.Iterable):
119
+ raise TypeError('Slice_bool.__iadd__ takes a sequence as argument')
120
+ for elt in value:
121
+ self.append(elt)
122
+ return self
123
+ def __iter__(self):
124
+ self.index = 0
125
+ return self
126
+ def __next__(self):
127
+ if self.index < len(self):
128
+ rv = _api.Slice_bool_elem(self.handle, self.index)
129
+ self.index = self.index + 1
130
+ return rv
131
+ raise StopIteration
132
+ def append(self, value):
133
+ _api.Slice_bool_append(self.handle, value)
134
+ def copy(self, src):
135
+ """ copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
136
+ mx = min(len(self), len(src))
137
+ for i in range(mx):
138
+ self[i] = src[i]
139
+
140
+ # Python type for slice []byte
141
+ class Slice_byte(GoClass):
142
+ """"""
143
+ def __init__(self, *args, **kwargs):
144
+ """
145
+ handle=A Go-side object is always initialized with an explicit handle=arg
146
+ otherwise parameter is a python list that we copy from
147
+ """
148
+ self.index = 0
149
+ if len(kwargs) == 1 and 'handle' in kwargs:
150
+ self.handle = kwargs['handle']
151
+ _api.IncRef(self.handle)
152
+ elif len(args) == 1 and isinstance(args[0], GoClass):
153
+ self.handle = args[0].handle
154
+ _api.IncRef(self.handle)
155
+ else:
156
+ self.handle = _api.Slice_byte_CTor()
157
+ _api.IncRef(self.handle)
158
+ if len(args) > 0:
159
+ if not isinstance(args[0], _collections_abc.Iterable):
160
+ raise TypeError('Slice_byte.__init__ takes a sequence as argument')
161
+ for elt in args[0]:
162
+ self.append(elt)
163
+ def __del__(self):
164
+ _api.DecRef(self.handle)
165
+ def __str__(self):
166
+ s = 'go.Slice_byte len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
167
+ if len(self) < 120:
168
+ s += ', '.join(map(str, self)) + ']'
169
+ return s
170
+ def __repr__(self):
171
+ return 'go.Slice_byte([' + ', '.join(map(str, self)) + '])'
172
+ def __len__(self):
173
+ return _api.Slice_byte_len(self.handle)
174
+ def __getitem__(self, key):
175
+ if isinstance(key, slice):
176
+ if key.step == None or key.step == 1:
177
+ st = key.start
178
+ ed = key.stop
179
+ if st == None:
180
+ st = 0
181
+ if ed == None:
182
+ ed = _api.Slice_byte_len(self.handle)
183
+ return Slice_byte(handle=_api.Slice_byte_subslice(self.handle, st, ed))
184
+ return [self[ii] for ii in range(*key.indices(len(self)))]
185
+ elif isinstance(key, int):
186
+ if key < 0:
187
+ key += len(self)
188
+ if key < 0 or key >= len(self):
189
+ raise IndexError('slice index out of range')
190
+ return _api.Slice_byte_elem(self.handle, key)
191
+ else:
192
+ raise TypeError('slice index invalid type')
193
+ def __setitem__(self, idx, value):
194
+ if idx < 0:
195
+ idx += len(self)
196
+ if idx < len(self):
197
+ _api.Slice_byte_set(self.handle, idx, value)
198
+ return
199
+ raise IndexError('slice index out of range')
200
+ def __iadd__(self, value):
201
+ if not isinstance(value, _collections_abc.Iterable):
202
+ raise TypeError('Slice_byte.__iadd__ takes a sequence as argument')
203
+ for elt in value:
204
+ self.append(elt)
205
+ return self
206
+ def __iter__(self):
207
+ self.index = 0
208
+ return self
209
+ def __next__(self):
210
+ if self.index < len(self):
211
+ rv = _api.Slice_byte_elem(self.handle, self.index)
212
+ self.index = self.index + 1
213
+ return rv
214
+ raise StopIteration
215
+ def append(self, value):
216
+ _api.Slice_byte_append(self.handle, value)
217
+ def copy(self, src):
218
+ """ copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
219
+ mx = min(len(self), len(src))
220
+ for i in range(mx):
221
+ self[i] = src[i]
222
+ @staticmethod
223
+ def from_bytes(value):
224
+ """Create a Go []byte object from a Python bytes object"""
225
+ handle = _api.Slice_byte_from_bytes(value)
226
+ return Slice_byte(handle=handle)
227
+ def __bytes__(self):
228
+ """Convert the slice to a bytes object."""
229
+ return _api.Slice_byte_to_bytes(self.handle)
230
+
231
+ # Python type for slice []error
232
+ class Slice_error(GoClass):
233
+ """"""
234
+ def __init__(self, *args, **kwargs):
235
+ """
236
+ handle=A Go-side object is always initialized with an explicit handle=arg
237
+ otherwise parameter is a python list that we copy from
238
+ """
239
+ self.index = 0
240
+ if len(kwargs) == 1 and 'handle' in kwargs:
241
+ self.handle = kwargs['handle']
242
+ _api.IncRef(self.handle)
243
+ elif len(args) == 1 and isinstance(args[0], GoClass):
244
+ self.handle = args[0].handle
245
+ _api.IncRef(self.handle)
246
+ else:
247
+ self.handle = _api.Slice_error_CTor()
248
+ _api.IncRef(self.handle)
249
+ if len(args) > 0:
250
+ if not isinstance(args[0], _collections_abc.Iterable):
251
+ raise TypeError('Slice_error.__init__ takes a sequence as argument')
252
+ for elt in args[0]:
253
+ self.append(elt)
254
+ def __del__(self):
255
+ _api.DecRef(self.handle)
256
+ def __str__(self):
257
+ s = 'go.Slice_error len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
258
+ if len(self) < 120:
259
+ s += ', '.join(map(str, self)) + ']'
260
+ return s
261
+ def __repr__(self):
262
+ return 'go.Slice_error([' + ', '.join(map(str, self)) + '])'
263
+ def __len__(self):
264
+ return _api.Slice_error_len(self.handle)
265
+ def __getitem__(self, key):
266
+ if isinstance(key, slice):
267
+ if key.step == None or key.step == 1:
268
+ st = key.start
269
+ ed = key.stop
270
+ if st == None:
271
+ st = 0
272
+ if ed == None:
273
+ ed = _api.Slice_error_len(self.handle)
274
+ return Slice_error(handle=_api.Slice_error_subslice(self.handle, st, ed))
275
+ return [self[ii] for ii in range(*key.indices(len(self)))]
276
+ elif isinstance(key, int):
277
+ if key < 0:
278
+ key += len(self)
279
+ if key < 0 or key >= len(self):
280
+ raise IndexError('slice index out of range')
281
+ return _api.Slice_error_elem(self.handle, key)
282
+ else:
283
+ raise TypeError('slice index invalid type')
284
+ def __setitem__(self, idx, value):
285
+ if idx < 0:
286
+ idx += len(self)
287
+ if idx < len(self):
288
+ _api.Slice_error_set(self.handle, idx, value)
289
+ return
290
+ raise IndexError('slice index out of range')
291
+ def __iadd__(self, value):
292
+ if not isinstance(value, _collections_abc.Iterable):
293
+ raise TypeError('Slice_error.__iadd__ takes a sequence as argument')
294
+ for elt in value:
295
+ self.append(elt)
296
+ return self
297
+ def __iter__(self):
298
+ self.index = 0
299
+ return self
300
+ def __next__(self):
301
+ if self.index < len(self):
302
+ rv = _api.Slice_error_elem(self.handle, self.index)
303
+ self.index = self.index + 1
304
+ return rv
305
+ raise StopIteration
306
+ def append(self, value):
307
+ _api.Slice_error_append(self.handle, value)
308
+ def copy(self, src):
309
+ """ copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
310
+ mx = min(len(self), len(src))
311
+ for i in range(mx):
312
+ self[i] = src[i]
313
+
314
+ # Python type for slice []float32
315
+ class Slice_float32(GoClass):
316
+ """"""
317
+ def __init__(self, *args, **kwargs):
318
+ """
319
+ handle=A Go-side object is always initialized with an explicit handle=arg
320
+ otherwise parameter is a python list that we copy from
321
+ """
322
+ self.index = 0
323
+ if len(kwargs) == 1 and 'handle' in kwargs:
324
+ self.handle = kwargs['handle']
325
+ _api.IncRef(self.handle)
326
+ elif len(args) == 1 and isinstance(args[0], GoClass):
327
+ self.handle = args[0].handle
328
+ _api.IncRef(self.handle)
329
+ else:
330
+ self.handle = _api.Slice_float32_CTor()
331
+ _api.IncRef(self.handle)
332
+ if len(args) > 0:
333
+ if not isinstance(args[0], _collections_abc.Iterable):
334
+ raise TypeError('Slice_float32.__init__ takes a sequence as argument')
335
+ for elt in args[0]:
336
+ self.append(elt)
337
+ def __del__(self):
338
+ _api.DecRef(self.handle)
339
+ def __str__(self):
340
+ s = 'go.Slice_float32 len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
341
+ if len(self) < 120:
342
+ s += ', '.join(map(str, self)) + ']'
343
+ return s
344
+ def __repr__(self):
345
+ return 'go.Slice_float32([' + ', '.join(map(str, self)) + '])'
346
+ def __len__(self):
347
+ return _api.Slice_float32_len(self.handle)
348
+ def __getitem__(self, key):
349
+ if isinstance(key, slice):
350
+ if key.step == None or key.step == 1:
351
+ st = key.start
352
+ ed = key.stop
353
+ if st == None:
354
+ st = 0
355
+ if ed == None:
356
+ ed = _api.Slice_float32_len(self.handle)
357
+ return Slice_float32(handle=_api.Slice_float32_subslice(self.handle, st, ed))
358
+ return [self[ii] for ii in range(*key.indices(len(self)))]
359
+ elif isinstance(key, int):
360
+ if key < 0:
361
+ key += len(self)
362
+ if key < 0 or key >= len(self):
363
+ raise IndexError('slice index out of range')
364
+ return _api.Slice_float32_elem(self.handle, key)
365
+ else:
366
+ raise TypeError('slice index invalid type')
367
+ def __setitem__(self, idx, value):
368
+ if idx < 0:
369
+ idx += len(self)
370
+ if idx < len(self):
371
+ _api.Slice_float32_set(self.handle, idx, value)
372
+ return
373
+ raise IndexError('slice index out of range')
374
+ def __iadd__(self, value):
375
+ if not isinstance(value, _collections_abc.Iterable):
376
+ raise TypeError('Slice_float32.__iadd__ takes a sequence as argument')
377
+ for elt in value:
378
+ self.append(elt)
379
+ return self
380
+ def __iter__(self):
381
+ self.index = 0
382
+ return self
383
+ def __next__(self):
384
+ if self.index < len(self):
385
+ rv = _api.Slice_float32_elem(self.handle, self.index)
386
+ self.index = self.index + 1
387
+ return rv
388
+ raise StopIteration
389
+ def append(self, value):
390
+ _api.Slice_float32_append(self.handle, value)
391
+ def copy(self, src):
392
+ """ copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
393
+ mx = min(len(self), len(src))
394
+ for i in range(mx):
395
+ self[i] = src[i]
396
+
397
+ # Python type for slice []float64
398
+ class Slice_float64(GoClass):
399
+ """"""
400
+ def __init__(self, *args, **kwargs):
401
+ """
402
+ handle=A Go-side object is always initialized with an explicit handle=arg
403
+ otherwise parameter is a python list that we copy from
404
+ """
405
+ self.index = 0
406
+ if len(kwargs) == 1 and 'handle' in kwargs:
407
+ self.handle = kwargs['handle']
408
+ _api.IncRef(self.handle)
409
+ elif len(args) == 1 and isinstance(args[0], GoClass):
410
+ self.handle = args[0].handle
411
+ _api.IncRef(self.handle)
412
+ else:
413
+ self.handle = _api.Slice_float64_CTor()
414
+ _api.IncRef(self.handle)
415
+ if len(args) > 0:
416
+ if not isinstance(args[0], _collections_abc.Iterable):
417
+ raise TypeError('Slice_float64.__init__ takes a sequence as argument')
418
+ for elt in args[0]:
419
+ self.append(elt)
420
+ def __del__(self):
421
+ _api.DecRef(self.handle)
422
+ def __str__(self):
423
+ s = 'go.Slice_float64 len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
424
+ if len(self) < 120:
425
+ s += ', '.join(map(str, self)) + ']'
426
+ return s
427
+ def __repr__(self):
428
+ return 'go.Slice_float64([' + ', '.join(map(str, self)) + '])'
429
+ def __len__(self):
430
+ return _api.Slice_float64_len(self.handle)
431
+ def __getitem__(self, key):
432
+ if isinstance(key, slice):
433
+ if key.step == None or key.step == 1:
434
+ st = key.start
435
+ ed = key.stop
436
+ if st == None:
437
+ st = 0
438
+ if ed == None:
439
+ ed = _api.Slice_float64_len(self.handle)
440
+ return Slice_float64(handle=_api.Slice_float64_subslice(self.handle, st, ed))
441
+ return [self[ii] for ii in range(*key.indices(len(self)))]
442
+ elif isinstance(key, int):
443
+ if key < 0:
444
+ key += len(self)
445
+ if key < 0 or key >= len(self):
446
+ raise IndexError('slice index out of range')
447
+ return _api.Slice_float64_elem(self.handle, key)
448
+ else:
449
+ raise TypeError('slice index invalid type')
450
+ def __setitem__(self, idx, value):
451
+ if idx < 0:
452
+ idx += len(self)
453
+ if idx < len(self):
454
+ _api.Slice_float64_set(self.handle, idx, value)
455
+ return
456
+ raise IndexError('slice index out of range')
457
+ def __iadd__(self, value):
458
+ if not isinstance(value, _collections_abc.Iterable):
459
+ raise TypeError('Slice_float64.__iadd__ takes a sequence as argument')
460
+ for elt in value:
461
+ self.append(elt)
462
+ return self
463
+ def __iter__(self):
464
+ self.index = 0
465
+ return self
466
+ def __next__(self):
467
+ if self.index < len(self):
468
+ rv = _api.Slice_float64_elem(self.handle, self.index)
469
+ self.index = self.index + 1
470
+ return rv
471
+ raise StopIteration
472
+ def append(self, value):
473
+ _api.Slice_float64_append(self.handle, value)
474
+ def copy(self, src):
475
+ """ copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
476
+ mx = min(len(self), len(src))
477
+ for i in range(mx):
478
+ self[i] = src[i]
479
+
480
+ # Python type for slice []int
481
+ class Slice_int(GoClass):
482
+ """"""
483
+ def __init__(self, *args, **kwargs):
484
+ """
485
+ handle=A Go-side object is always initialized with an explicit handle=arg
486
+ otherwise parameter is a python list that we copy from
487
+ """
488
+ self.index = 0
489
+ if len(kwargs) == 1 and 'handle' in kwargs:
490
+ self.handle = kwargs['handle']
491
+ _api.IncRef(self.handle)
492
+ elif len(args) == 1 and isinstance(args[0], GoClass):
493
+ self.handle = args[0].handle
494
+ _api.IncRef(self.handle)
495
+ else:
496
+ self.handle = _api.Slice_int_CTor()
497
+ _api.IncRef(self.handle)
498
+ if len(args) > 0:
499
+ if not isinstance(args[0], _collections_abc.Iterable):
500
+ raise TypeError('Slice_int.__init__ takes a sequence as argument')
501
+ for elt in args[0]:
502
+ self.append(elt)
503
+ def __del__(self):
504
+ _api.DecRef(self.handle)
505
+ def __str__(self):
506
+ s = 'go.Slice_int len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
507
+ if len(self) < 120:
508
+ s += ', '.join(map(str, self)) + ']'
509
+ return s
510
+ def __repr__(self):
511
+ return 'go.Slice_int([' + ', '.join(map(str, self)) + '])'
512
+ def __len__(self):
513
+ return _api.Slice_int_len(self.handle)
514
+ def __getitem__(self, key):
515
+ if isinstance(key, slice):
516
+ if key.step == None or key.step == 1:
517
+ st = key.start
518
+ ed = key.stop
519
+ if st == None:
520
+ st = 0
521
+ if ed == None:
522
+ ed = _api.Slice_int_len(self.handle)
523
+ return Slice_int(handle=_api.Slice_int_subslice(self.handle, st, ed))
524
+ return [self[ii] for ii in range(*key.indices(len(self)))]
525
+ elif isinstance(key, int):
526
+ if key < 0:
527
+ key += len(self)
528
+ if key < 0 or key >= len(self):
529
+ raise IndexError('slice index out of range')
530
+ return _api.Slice_int_elem(self.handle, key)
531
+ else:
532
+ raise TypeError('slice index invalid type')
533
+ def __setitem__(self, idx, value):
534
+ if idx < 0:
535
+ idx += len(self)
536
+ if idx < len(self):
537
+ _api.Slice_int_set(self.handle, idx, value)
538
+ return
539
+ raise IndexError('slice index out of range')
540
+ def __iadd__(self, value):
541
+ if not isinstance(value, _collections_abc.Iterable):
542
+ raise TypeError('Slice_int.__iadd__ takes a sequence as argument')
543
+ for elt in value:
544
+ self.append(elt)
545
+ return self
546
+ def __iter__(self):
547
+ self.index = 0
548
+ return self
549
+ def __next__(self):
550
+ if self.index < len(self):
551
+ rv = _api.Slice_int_elem(self.handle, self.index)
552
+ self.index = self.index + 1
553
+ return rv
554
+ raise StopIteration
555
+ def append(self, value):
556
+ _api.Slice_int_append(self.handle, value)
557
+ def copy(self, src):
558
+ """ copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
559
+ mx = min(len(self), len(src))
560
+ for i in range(mx):
561
+ self[i] = src[i]
562
+
563
+ # Python type for slice []int16
564
+ class Slice_int16(GoClass):
565
+ """"""
566
+ def __init__(self, *args, **kwargs):
567
+ """
568
+ handle=A Go-side object is always initialized with an explicit handle=arg
569
+ otherwise parameter is a python list that we copy from
570
+ """
571
+ self.index = 0
572
+ if len(kwargs) == 1 and 'handle' in kwargs:
573
+ self.handle = kwargs['handle']
574
+ _api.IncRef(self.handle)
575
+ elif len(args) == 1 and isinstance(args[0], GoClass):
576
+ self.handle = args[0].handle
577
+ _api.IncRef(self.handle)
578
+ else:
579
+ self.handle = _api.Slice_int16_CTor()
580
+ _api.IncRef(self.handle)
581
+ if len(args) > 0:
582
+ if not isinstance(args[0], _collections_abc.Iterable):
583
+ raise TypeError('Slice_int16.__init__ takes a sequence as argument')
584
+ for elt in args[0]:
585
+ self.append(elt)
586
+ def __del__(self):
587
+ _api.DecRef(self.handle)
588
+ def __str__(self):
589
+ s = 'go.Slice_int16 len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
590
+ if len(self) < 120:
591
+ s += ', '.join(map(str, self)) + ']'
592
+ return s
593
+ def __repr__(self):
594
+ return 'go.Slice_int16([' + ', '.join(map(str, self)) + '])'
595
+ def __len__(self):
596
+ return _api.Slice_int16_len(self.handle)
597
+ def __getitem__(self, key):
598
+ if isinstance(key, slice):
599
+ if key.step == None or key.step == 1:
600
+ st = key.start
601
+ ed = key.stop
602
+ if st == None:
603
+ st = 0
604
+ if ed == None:
605
+ ed = _api.Slice_int16_len(self.handle)
606
+ return Slice_int16(handle=_api.Slice_int16_subslice(self.handle, st, ed))
607
+ return [self[ii] for ii in range(*key.indices(len(self)))]
608
+ elif isinstance(key, int):
609
+ if key < 0:
610
+ key += len(self)
611
+ if key < 0 or key >= len(self):
612
+ raise IndexError('slice index out of range')
613
+ return _api.Slice_int16_elem(self.handle, key)
614
+ else:
615
+ raise TypeError('slice index invalid type')
616
+ def __setitem__(self, idx, value):
617
+ if idx < 0:
618
+ idx += len(self)
619
+ if idx < len(self):
620
+ _api.Slice_int16_set(self.handle, idx, value)
621
+ return
622
+ raise IndexError('slice index out of range')
623
+ def __iadd__(self, value):
624
+ if not isinstance(value, _collections_abc.Iterable):
625
+ raise TypeError('Slice_int16.__iadd__ takes a sequence as argument')
626
+ for elt in value:
627
+ self.append(elt)
628
+ return self
629
+ def __iter__(self):
630
+ self.index = 0
631
+ return self
632
+ def __next__(self):
633
+ if self.index < len(self):
634
+ rv = _api.Slice_int16_elem(self.handle, self.index)
635
+ self.index = self.index + 1
636
+ return rv
637
+ raise StopIteration
638
+ def append(self, value):
639
+ _api.Slice_int16_append(self.handle, value)
640
+ def copy(self, src):
641
+ """ copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
642
+ mx = min(len(self), len(src))
643
+ for i in range(mx):
644
+ self[i] = src[i]
645
+
646
+ # Python type for slice []int32
647
+ class Slice_int32(GoClass):
648
+ """"""
649
+ def __init__(self, *args, **kwargs):
650
+ """
651
+ handle=A Go-side object is always initialized with an explicit handle=arg
652
+ otherwise parameter is a python list that we copy from
653
+ """
654
+ self.index = 0
655
+ if len(kwargs) == 1 and 'handle' in kwargs:
656
+ self.handle = kwargs['handle']
657
+ _api.IncRef(self.handle)
658
+ elif len(args) == 1 and isinstance(args[0], GoClass):
659
+ self.handle = args[0].handle
660
+ _api.IncRef(self.handle)
661
+ else:
662
+ self.handle = _api.Slice_int32_CTor()
663
+ _api.IncRef(self.handle)
664
+ if len(args) > 0:
665
+ if not isinstance(args[0], _collections_abc.Iterable):
666
+ raise TypeError('Slice_int32.__init__ takes a sequence as argument')
667
+ for elt in args[0]:
668
+ self.append(elt)
669
+ def __del__(self):
670
+ _api.DecRef(self.handle)
671
+ def __str__(self):
672
+ s = 'go.Slice_int32 len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
673
+ if len(self) < 120:
674
+ s += ', '.join(map(str, self)) + ']'
675
+ return s
676
+ def __repr__(self):
677
+ return 'go.Slice_int32([' + ', '.join(map(str, self)) + '])'
678
+ def __len__(self):
679
+ return _api.Slice_int32_len(self.handle)
680
+ def __getitem__(self, key):
681
+ if isinstance(key, slice):
682
+ if key.step == None or key.step == 1:
683
+ st = key.start
684
+ ed = key.stop
685
+ if st == None:
686
+ st = 0
687
+ if ed == None:
688
+ ed = _api.Slice_int32_len(self.handle)
689
+ return Slice_int32(handle=_api.Slice_int32_subslice(self.handle, st, ed))
690
+ return [self[ii] for ii in range(*key.indices(len(self)))]
691
+ elif isinstance(key, int):
692
+ if key < 0:
693
+ key += len(self)
694
+ if key < 0 or key >= len(self):
695
+ raise IndexError('slice index out of range')
696
+ return _api.Slice_int32_elem(self.handle, key)
697
+ else:
698
+ raise TypeError('slice index invalid type')
699
+ def __setitem__(self, idx, value):
700
+ if idx < 0:
701
+ idx += len(self)
702
+ if idx < len(self):
703
+ _api.Slice_int32_set(self.handle, idx, value)
704
+ return
705
+ raise IndexError('slice index out of range')
706
+ def __iadd__(self, value):
707
+ if not isinstance(value, _collections_abc.Iterable):
708
+ raise TypeError('Slice_int32.__iadd__ takes a sequence as argument')
709
+ for elt in value:
710
+ self.append(elt)
711
+ return self
712
+ def __iter__(self):
713
+ self.index = 0
714
+ return self
715
+ def __next__(self):
716
+ if self.index < len(self):
717
+ rv = _api.Slice_int32_elem(self.handle, self.index)
718
+ self.index = self.index + 1
719
+ return rv
720
+ raise StopIteration
721
+ def append(self, value):
722
+ _api.Slice_int32_append(self.handle, value)
723
+ def copy(self, src):
724
+ """ copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
725
+ mx = min(len(self), len(src))
726
+ for i in range(mx):
727
+ self[i] = src[i]
728
+
729
+ # Python type for slice []int64
730
+ class Slice_int64(GoClass):
731
+ """"""
732
+ def __init__(self, *args, **kwargs):
733
+ """
734
+ handle=A Go-side object is always initialized with an explicit handle=arg
735
+ otherwise parameter is a python list that we copy from
736
+ """
737
+ self.index = 0
738
+ if len(kwargs) == 1 and 'handle' in kwargs:
739
+ self.handle = kwargs['handle']
740
+ _api.IncRef(self.handle)
741
+ elif len(args) == 1 and isinstance(args[0], GoClass):
742
+ self.handle = args[0].handle
743
+ _api.IncRef(self.handle)
744
+ else:
745
+ self.handle = _api.Slice_int64_CTor()
746
+ _api.IncRef(self.handle)
747
+ if len(args) > 0:
748
+ if not isinstance(args[0], _collections_abc.Iterable):
749
+ raise TypeError('Slice_int64.__init__ takes a sequence as argument')
750
+ for elt in args[0]:
751
+ self.append(elt)
752
+ def __del__(self):
753
+ _api.DecRef(self.handle)
754
+ def __str__(self):
755
+ s = 'go.Slice_int64 len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
756
+ if len(self) < 120:
757
+ s += ', '.join(map(str, self)) + ']'
758
+ return s
759
+ def __repr__(self):
760
+ return 'go.Slice_int64([' + ', '.join(map(str, self)) + '])'
761
+ def __len__(self):
762
+ return _api.Slice_int64_len(self.handle)
763
+ def __getitem__(self, key):
764
+ if isinstance(key, slice):
765
+ if key.step == None or key.step == 1:
766
+ st = key.start
767
+ ed = key.stop
768
+ if st == None:
769
+ st = 0
770
+ if ed == None:
771
+ ed = _api.Slice_int64_len(self.handle)
772
+ return Slice_int64(handle=_api.Slice_int64_subslice(self.handle, st, ed))
773
+ return [self[ii] for ii in range(*key.indices(len(self)))]
774
+ elif isinstance(key, int):
775
+ if key < 0:
776
+ key += len(self)
777
+ if key < 0 or key >= len(self):
778
+ raise IndexError('slice index out of range')
779
+ return _api.Slice_int64_elem(self.handle, key)
780
+ else:
781
+ raise TypeError('slice index invalid type')
782
+ def __setitem__(self, idx, value):
783
+ if idx < 0:
784
+ idx += len(self)
785
+ if idx < len(self):
786
+ _api.Slice_int64_set(self.handle, idx, value)
787
+ return
788
+ raise IndexError('slice index out of range')
789
+ def __iadd__(self, value):
790
+ if not isinstance(value, _collections_abc.Iterable):
791
+ raise TypeError('Slice_int64.__iadd__ takes a sequence as argument')
792
+ for elt in value:
793
+ self.append(elt)
794
+ return self
795
+ def __iter__(self):
796
+ self.index = 0
797
+ return self
798
+ def __next__(self):
799
+ if self.index < len(self):
800
+ rv = _api.Slice_int64_elem(self.handle, self.index)
801
+ self.index = self.index + 1
802
+ return rv
803
+ raise StopIteration
804
+ def append(self, value):
805
+ _api.Slice_int64_append(self.handle, value)
806
+ def copy(self, src):
807
+ """ copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
808
+ mx = min(len(self), len(src))
809
+ for i in range(mx):
810
+ self[i] = src[i]
811
+
812
+ # Python type for slice []int8
813
+ class Slice_int8(GoClass):
814
+ """"""
815
+ def __init__(self, *args, **kwargs):
816
+ """
817
+ handle=A Go-side object is always initialized with an explicit handle=arg
818
+ otherwise parameter is a python list that we copy from
819
+ """
820
+ self.index = 0
821
+ if len(kwargs) == 1 and 'handle' in kwargs:
822
+ self.handle = kwargs['handle']
823
+ _api.IncRef(self.handle)
824
+ elif len(args) == 1 and isinstance(args[0], GoClass):
825
+ self.handle = args[0].handle
826
+ _api.IncRef(self.handle)
827
+ else:
828
+ self.handle = _api.Slice_int8_CTor()
829
+ _api.IncRef(self.handle)
830
+ if len(args) > 0:
831
+ if not isinstance(args[0], _collections_abc.Iterable):
832
+ raise TypeError('Slice_int8.__init__ takes a sequence as argument')
833
+ for elt in args[0]:
834
+ self.append(elt)
835
+ def __del__(self):
836
+ _api.DecRef(self.handle)
837
+ def __str__(self):
838
+ s = 'go.Slice_int8 len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
839
+ if len(self) < 120:
840
+ s += ', '.join(map(str, self)) + ']'
841
+ return s
842
+ def __repr__(self):
843
+ return 'go.Slice_int8([' + ', '.join(map(str, self)) + '])'
844
+ def __len__(self):
845
+ return _api.Slice_int8_len(self.handle)
846
+ def __getitem__(self, key):
847
+ if isinstance(key, slice):
848
+ if key.step == None or key.step == 1:
849
+ st = key.start
850
+ ed = key.stop
851
+ if st == None:
852
+ st = 0
853
+ if ed == None:
854
+ ed = _api.Slice_int8_len(self.handle)
855
+ return Slice_int8(handle=_api.Slice_int8_subslice(self.handle, st, ed))
856
+ return [self[ii] for ii in range(*key.indices(len(self)))]
857
+ elif isinstance(key, int):
858
+ if key < 0:
859
+ key += len(self)
860
+ if key < 0 or key >= len(self):
861
+ raise IndexError('slice index out of range')
862
+ return _api.Slice_int8_elem(self.handle, key)
863
+ else:
864
+ raise TypeError('slice index invalid type')
865
+ def __setitem__(self, idx, value):
866
+ if idx < 0:
867
+ idx += len(self)
868
+ if idx < len(self):
869
+ _api.Slice_int8_set(self.handle, idx, value)
870
+ return
871
+ raise IndexError('slice index out of range')
872
+ def __iadd__(self, value):
873
+ if not isinstance(value, _collections_abc.Iterable):
874
+ raise TypeError('Slice_int8.__iadd__ takes a sequence as argument')
875
+ for elt in value:
876
+ self.append(elt)
877
+ return self
878
+ def __iter__(self):
879
+ self.index = 0
880
+ return self
881
+ def __next__(self):
882
+ if self.index < len(self):
883
+ rv = _api.Slice_int8_elem(self.handle, self.index)
884
+ self.index = self.index + 1
885
+ return rv
886
+ raise StopIteration
887
+ def append(self, value):
888
+ _api.Slice_int8_append(self.handle, value)
889
+ def copy(self, src):
890
+ """ copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
891
+ mx = min(len(self), len(src))
892
+ for i in range(mx):
893
+ self[i] = src[i]
894
+
895
+ # Python type for slice []rune
896
+ class Slice_rune(GoClass):
897
+ """"""
898
+ def __init__(self, *args, **kwargs):
899
+ """
900
+ handle=A Go-side object is always initialized with an explicit handle=arg
901
+ otherwise parameter is a python list that we copy from
902
+ """
903
+ self.index = 0
904
+ if len(kwargs) == 1 and 'handle' in kwargs:
905
+ self.handle = kwargs['handle']
906
+ _api.IncRef(self.handle)
907
+ elif len(args) == 1 and isinstance(args[0], GoClass):
908
+ self.handle = args[0].handle
909
+ _api.IncRef(self.handle)
910
+ else:
911
+ self.handle = _api.Slice_rune_CTor()
912
+ _api.IncRef(self.handle)
913
+ if len(args) > 0:
914
+ if not isinstance(args[0], _collections_abc.Iterable):
915
+ raise TypeError('Slice_rune.__init__ takes a sequence as argument')
916
+ for elt in args[0]:
917
+ self.append(elt)
918
+ def __del__(self):
919
+ _api.DecRef(self.handle)
920
+ def __str__(self):
921
+ s = 'go.Slice_rune len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
922
+ if len(self) < 120:
923
+ s += ', '.join(map(str, self)) + ']'
924
+ return s
925
+ def __repr__(self):
926
+ return 'go.Slice_rune([' + ', '.join(map(str, self)) + '])'
927
+ def __len__(self):
928
+ return _api.Slice_rune_len(self.handle)
929
+ def __getitem__(self, key):
930
+ if isinstance(key, slice):
931
+ if key.step == None or key.step == 1:
932
+ st = key.start
933
+ ed = key.stop
934
+ if st == None:
935
+ st = 0
936
+ if ed == None:
937
+ ed = _api.Slice_rune_len(self.handle)
938
+ return Slice_rune(handle=_api.Slice_rune_subslice(self.handle, st, ed))
939
+ return [self[ii] for ii in range(*key.indices(len(self)))]
940
+ elif isinstance(key, int):
941
+ if key < 0:
942
+ key += len(self)
943
+ if key < 0 or key >= len(self):
944
+ raise IndexError('slice index out of range')
945
+ return _api.Slice_rune_elem(self.handle, key)
946
+ else:
947
+ raise TypeError('slice index invalid type')
948
+ def __setitem__(self, idx, value):
949
+ if idx < 0:
950
+ idx += len(self)
951
+ if idx < len(self):
952
+ _api.Slice_rune_set(self.handle, idx, value)
953
+ return
954
+ raise IndexError('slice index out of range')
955
+ def __iadd__(self, value):
956
+ if not isinstance(value, _collections_abc.Iterable):
957
+ raise TypeError('Slice_rune.__iadd__ takes a sequence as argument')
958
+ for elt in value:
959
+ self.append(elt)
960
+ return self
961
+ def __iter__(self):
962
+ self.index = 0
963
+ return self
964
+ def __next__(self):
965
+ if self.index < len(self):
966
+ rv = _api.Slice_rune_elem(self.handle, self.index)
967
+ self.index = self.index + 1
968
+ return rv
969
+ raise StopIteration
970
+ def append(self, value):
971
+ _api.Slice_rune_append(self.handle, value)
972
+ def copy(self, src):
973
+ """ copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
974
+ mx = min(len(self), len(src))
975
+ for i in range(mx):
976
+ self[i] = src[i]
977
+
978
+ # Python type for slice []string
979
+ class Slice_string(GoClass):
980
+ """"""
981
+ def __init__(self, *args, **kwargs):
982
+ """
983
+ handle=A Go-side object is always initialized with an explicit handle=arg
984
+ otherwise parameter is a python list that we copy from
985
+ """
986
+ self.index = 0
987
+ if len(kwargs) == 1 and 'handle' in kwargs:
988
+ self.handle = kwargs['handle']
989
+ _api.IncRef(self.handle)
990
+ elif len(args) == 1 and isinstance(args[0], GoClass):
991
+ self.handle = args[0].handle
992
+ _api.IncRef(self.handle)
993
+ else:
994
+ self.handle = _api.Slice_string_CTor()
995
+ _api.IncRef(self.handle)
996
+ if len(args) > 0:
997
+ if not isinstance(args[0], _collections_abc.Iterable):
998
+ raise TypeError('Slice_string.__init__ takes a sequence as argument')
999
+ for elt in args[0]:
1000
+ self.append(elt)
1001
+ def __del__(self):
1002
+ _api.DecRef(self.handle)
1003
+ def __str__(self):
1004
+ s = 'go.Slice_string len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
1005
+ if len(self) < 120:
1006
+ s += ', '.join(map(str, self)) + ']'
1007
+ return s
1008
+ def __repr__(self):
1009
+ return 'go.Slice_string([' + ', '.join(map(str, self)) + '])'
1010
+ def __len__(self):
1011
+ return _api.Slice_string_len(self.handle)
1012
+ def __getitem__(self, key):
1013
+ if isinstance(key, slice):
1014
+ if key.step == None or key.step == 1:
1015
+ st = key.start
1016
+ ed = key.stop
1017
+ if st == None:
1018
+ st = 0
1019
+ if ed == None:
1020
+ ed = _api.Slice_string_len(self.handle)
1021
+ return Slice_string(handle=_api.Slice_string_subslice(self.handle, st, ed))
1022
+ return [self[ii] for ii in range(*key.indices(len(self)))]
1023
+ elif isinstance(key, int):
1024
+ if key < 0:
1025
+ key += len(self)
1026
+ if key < 0 or key >= len(self):
1027
+ raise IndexError('slice index out of range')
1028
+ return _api.Slice_string_elem(self.handle, key)
1029
+ else:
1030
+ raise TypeError('slice index invalid type')
1031
+ def __setitem__(self, idx, value):
1032
+ if idx < 0:
1033
+ idx += len(self)
1034
+ if idx < len(self):
1035
+ _api.Slice_string_set(self.handle, idx, value)
1036
+ return
1037
+ raise IndexError('slice index out of range')
1038
+ def __iadd__(self, value):
1039
+ if not isinstance(value, _collections_abc.Iterable):
1040
+ raise TypeError('Slice_string.__iadd__ takes a sequence as argument')
1041
+ for elt in value:
1042
+ self.append(elt)
1043
+ return self
1044
+ def __iter__(self):
1045
+ self.index = 0
1046
+ return self
1047
+ def __next__(self):
1048
+ if self.index < len(self):
1049
+ rv = _api.Slice_string_elem(self.handle, self.index)
1050
+ self.index = self.index + 1
1051
+ return rv
1052
+ raise StopIteration
1053
+ def append(self, value):
1054
+ _api.Slice_string_append(self.handle, value)
1055
+ def copy(self, src):
1056
+ """ copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
1057
+ mx = min(len(self), len(src))
1058
+ for i in range(mx):
1059
+ self[i] = src[i]
1060
+
1061
+ # Python type for slice []uint
1062
+ class Slice_uint(GoClass):
1063
+ """"""
1064
+ def __init__(self, *args, **kwargs):
1065
+ """
1066
+ handle=A Go-side object is always initialized with an explicit handle=arg
1067
+ otherwise parameter is a python list that we copy from
1068
+ """
1069
+ self.index = 0
1070
+ if len(kwargs) == 1 and 'handle' in kwargs:
1071
+ self.handle = kwargs['handle']
1072
+ _api.IncRef(self.handle)
1073
+ elif len(args) == 1 and isinstance(args[0], GoClass):
1074
+ self.handle = args[0].handle
1075
+ _api.IncRef(self.handle)
1076
+ else:
1077
+ self.handle = _api.Slice_uint_CTor()
1078
+ _api.IncRef(self.handle)
1079
+ if len(args) > 0:
1080
+ if not isinstance(args[0], _collections_abc.Iterable):
1081
+ raise TypeError('Slice_uint.__init__ takes a sequence as argument')
1082
+ for elt in args[0]:
1083
+ self.append(elt)
1084
+ def __del__(self):
1085
+ _api.DecRef(self.handle)
1086
+ def __str__(self):
1087
+ s = 'go.Slice_uint len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
1088
+ if len(self) < 120:
1089
+ s += ', '.join(map(str, self)) + ']'
1090
+ return s
1091
+ def __repr__(self):
1092
+ return 'go.Slice_uint([' + ', '.join(map(str, self)) + '])'
1093
+ def __len__(self):
1094
+ return _api.Slice_uint_len(self.handle)
1095
+ def __getitem__(self, key):
1096
+ if isinstance(key, slice):
1097
+ if key.step == None or key.step == 1:
1098
+ st = key.start
1099
+ ed = key.stop
1100
+ if st == None:
1101
+ st = 0
1102
+ if ed == None:
1103
+ ed = _api.Slice_uint_len(self.handle)
1104
+ return Slice_uint(handle=_api.Slice_uint_subslice(self.handle, st, ed))
1105
+ return [self[ii] for ii in range(*key.indices(len(self)))]
1106
+ elif isinstance(key, int):
1107
+ if key < 0:
1108
+ key += len(self)
1109
+ if key < 0 or key >= len(self):
1110
+ raise IndexError('slice index out of range')
1111
+ return _api.Slice_uint_elem(self.handle, key)
1112
+ else:
1113
+ raise TypeError('slice index invalid type')
1114
+ def __setitem__(self, idx, value):
1115
+ if idx < 0:
1116
+ idx += len(self)
1117
+ if idx < len(self):
1118
+ _api.Slice_uint_set(self.handle, idx, value)
1119
+ return
1120
+ raise IndexError('slice index out of range')
1121
+ def __iadd__(self, value):
1122
+ if not isinstance(value, _collections_abc.Iterable):
1123
+ raise TypeError('Slice_uint.__iadd__ takes a sequence as argument')
1124
+ for elt in value:
1125
+ self.append(elt)
1126
+ return self
1127
+ def __iter__(self):
1128
+ self.index = 0
1129
+ return self
1130
+ def __next__(self):
1131
+ if self.index < len(self):
1132
+ rv = _api.Slice_uint_elem(self.handle, self.index)
1133
+ self.index = self.index + 1
1134
+ return rv
1135
+ raise StopIteration
1136
+ def append(self, value):
1137
+ _api.Slice_uint_append(self.handle, value)
1138
+ def copy(self, src):
1139
+ """ copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
1140
+ mx = min(len(self), len(src))
1141
+ for i in range(mx):
1142
+ self[i] = src[i]
1143
+
1144
+ # Python type for slice []uint16
1145
+ class Slice_uint16(GoClass):
1146
+ """"""
1147
+ def __init__(self, *args, **kwargs):
1148
+ """
1149
+ handle=A Go-side object is always initialized with an explicit handle=arg
1150
+ otherwise parameter is a python list that we copy from
1151
+ """
1152
+ self.index = 0
1153
+ if len(kwargs) == 1 and 'handle' in kwargs:
1154
+ self.handle = kwargs['handle']
1155
+ _api.IncRef(self.handle)
1156
+ elif len(args) == 1 and isinstance(args[0], GoClass):
1157
+ self.handle = args[0].handle
1158
+ _api.IncRef(self.handle)
1159
+ else:
1160
+ self.handle = _api.Slice_uint16_CTor()
1161
+ _api.IncRef(self.handle)
1162
+ if len(args) > 0:
1163
+ if not isinstance(args[0], _collections_abc.Iterable):
1164
+ raise TypeError('Slice_uint16.__init__ takes a sequence as argument')
1165
+ for elt in args[0]:
1166
+ self.append(elt)
1167
+ def __del__(self):
1168
+ _api.DecRef(self.handle)
1169
+ def __str__(self):
1170
+ s = 'go.Slice_uint16 len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
1171
+ if len(self) < 120:
1172
+ s += ', '.join(map(str, self)) + ']'
1173
+ return s
1174
+ def __repr__(self):
1175
+ return 'go.Slice_uint16([' + ', '.join(map(str, self)) + '])'
1176
+ def __len__(self):
1177
+ return _api.Slice_uint16_len(self.handle)
1178
+ def __getitem__(self, key):
1179
+ if isinstance(key, slice):
1180
+ if key.step == None or key.step == 1:
1181
+ st = key.start
1182
+ ed = key.stop
1183
+ if st == None:
1184
+ st = 0
1185
+ if ed == None:
1186
+ ed = _api.Slice_uint16_len(self.handle)
1187
+ return Slice_uint16(handle=_api.Slice_uint16_subslice(self.handle, st, ed))
1188
+ return [self[ii] for ii in range(*key.indices(len(self)))]
1189
+ elif isinstance(key, int):
1190
+ if key < 0:
1191
+ key += len(self)
1192
+ if key < 0 or key >= len(self):
1193
+ raise IndexError('slice index out of range')
1194
+ return _api.Slice_uint16_elem(self.handle, key)
1195
+ else:
1196
+ raise TypeError('slice index invalid type')
1197
+ def __setitem__(self, idx, value):
1198
+ if idx < 0:
1199
+ idx += len(self)
1200
+ if idx < len(self):
1201
+ _api.Slice_uint16_set(self.handle, idx, value)
1202
+ return
1203
+ raise IndexError('slice index out of range')
1204
+ def __iadd__(self, value):
1205
+ if not isinstance(value, _collections_abc.Iterable):
1206
+ raise TypeError('Slice_uint16.__iadd__ takes a sequence as argument')
1207
+ for elt in value:
1208
+ self.append(elt)
1209
+ return self
1210
+ def __iter__(self):
1211
+ self.index = 0
1212
+ return self
1213
+ def __next__(self):
1214
+ if self.index < len(self):
1215
+ rv = _api.Slice_uint16_elem(self.handle, self.index)
1216
+ self.index = self.index + 1
1217
+ return rv
1218
+ raise StopIteration
1219
+ def append(self, value):
1220
+ _api.Slice_uint16_append(self.handle, value)
1221
+ def copy(self, src):
1222
+ """ copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
1223
+ mx = min(len(self), len(src))
1224
+ for i in range(mx):
1225
+ self[i] = src[i]
1226
+
1227
+ # Python type for slice []uint32
1228
+ class Slice_uint32(GoClass):
1229
+ """"""
1230
+ def __init__(self, *args, **kwargs):
1231
+ """
1232
+ handle=A Go-side object is always initialized with an explicit handle=arg
1233
+ otherwise parameter is a python list that we copy from
1234
+ """
1235
+ self.index = 0
1236
+ if len(kwargs) == 1 and 'handle' in kwargs:
1237
+ self.handle = kwargs['handle']
1238
+ _api.IncRef(self.handle)
1239
+ elif len(args) == 1 and isinstance(args[0], GoClass):
1240
+ self.handle = args[0].handle
1241
+ _api.IncRef(self.handle)
1242
+ else:
1243
+ self.handle = _api.Slice_uint32_CTor()
1244
+ _api.IncRef(self.handle)
1245
+ if len(args) > 0:
1246
+ if not isinstance(args[0], _collections_abc.Iterable):
1247
+ raise TypeError('Slice_uint32.__init__ takes a sequence as argument')
1248
+ for elt in args[0]:
1249
+ self.append(elt)
1250
+ def __del__(self):
1251
+ _api.DecRef(self.handle)
1252
+ def __str__(self):
1253
+ s = 'go.Slice_uint32 len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
1254
+ if len(self) < 120:
1255
+ s += ', '.join(map(str, self)) + ']'
1256
+ return s
1257
+ def __repr__(self):
1258
+ return 'go.Slice_uint32([' + ', '.join(map(str, self)) + '])'
1259
+ def __len__(self):
1260
+ return _api.Slice_uint32_len(self.handle)
1261
+ def __getitem__(self, key):
1262
+ if isinstance(key, slice):
1263
+ if key.step == None or key.step == 1:
1264
+ st = key.start
1265
+ ed = key.stop
1266
+ if st == None:
1267
+ st = 0
1268
+ if ed == None:
1269
+ ed = _api.Slice_uint32_len(self.handle)
1270
+ return Slice_uint32(handle=_api.Slice_uint32_subslice(self.handle, st, ed))
1271
+ return [self[ii] for ii in range(*key.indices(len(self)))]
1272
+ elif isinstance(key, int):
1273
+ if key < 0:
1274
+ key += len(self)
1275
+ if key < 0 or key >= len(self):
1276
+ raise IndexError('slice index out of range')
1277
+ return _api.Slice_uint32_elem(self.handle, key)
1278
+ else:
1279
+ raise TypeError('slice index invalid type')
1280
+ def __setitem__(self, idx, value):
1281
+ if idx < 0:
1282
+ idx += len(self)
1283
+ if idx < len(self):
1284
+ _api.Slice_uint32_set(self.handle, idx, value)
1285
+ return
1286
+ raise IndexError('slice index out of range')
1287
+ def __iadd__(self, value):
1288
+ if not isinstance(value, _collections_abc.Iterable):
1289
+ raise TypeError('Slice_uint32.__iadd__ takes a sequence as argument')
1290
+ for elt in value:
1291
+ self.append(elt)
1292
+ return self
1293
+ def __iter__(self):
1294
+ self.index = 0
1295
+ return self
1296
+ def __next__(self):
1297
+ if self.index < len(self):
1298
+ rv = _api.Slice_uint32_elem(self.handle, self.index)
1299
+ self.index = self.index + 1
1300
+ return rv
1301
+ raise StopIteration
1302
+ def append(self, value):
1303
+ _api.Slice_uint32_append(self.handle, value)
1304
+ def copy(self, src):
1305
+ """ copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
1306
+ mx = min(len(self), len(src))
1307
+ for i in range(mx):
1308
+ self[i] = src[i]
1309
+
1310
+ # Python type for slice []uint64
1311
+ class Slice_uint64(GoClass):
1312
+ """"""
1313
+ def __init__(self, *args, **kwargs):
1314
+ """
1315
+ handle=A Go-side object is always initialized with an explicit handle=arg
1316
+ otherwise parameter is a python list that we copy from
1317
+ """
1318
+ self.index = 0
1319
+ if len(kwargs) == 1 and 'handle' in kwargs:
1320
+ self.handle = kwargs['handle']
1321
+ _api.IncRef(self.handle)
1322
+ elif len(args) == 1 and isinstance(args[0], GoClass):
1323
+ self.handle = args[0].handle
1324
+ _api.IncRef(self.handle)
1325
+ else:
1326
+ self.handle = _api.Slice_uint64_CTor()
1327
+ _api.IncRef(self.handle)
1328
+ if len(args) > 0:
1329
+ if not isinstance(args[0], _collections_abc.Iterable):
1330
+ raise TypeError('Slice_uint64.__init__ takes a sequence as argument')
1331
+ for elt in args[0]:
1332
+ self.append(elt)
1333
+ def __del__(self):
1334
+ _api.DecRef(self.handle)
1335
+ def __str__(self):
1336
+ s = 'go.Slice_uint64 len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
1337
+ if len(self) < 120:
1338
+ s += ', '.join(map(str, self)) + ']'
1339
+ return s
1340
+ def __repr__(self):
1341
+ return 'go.Slice_uint64([' + ', '.join(map(str, self)) + '])'
1342
+ def __len__(self):
1343
+ return _api.Slice_uint64_len(self.handle)
1344
+ def __getitem__(self, key):
1345
+ if isinstance(key, slice):
1346
+ if key.step == None or key.step == 1:
1347
+ st = key.start
1348
+ ed = key.stop
1349
+ if st == None:
1350
+ st = 0
1351
+ if ed == None:
1352
+ ed = _api.Slice_uint64_len(self.handle)
1353
+ return Slice_uint64(handle=_api.Slice_uint64_subslice(self.handle, st, ed))
1354
+ return [self[ii] for ii in range(*key.indices(len(self)))]
1355
+ elif isinstance(key, int):
1356
+ if key < 0:
1357
+ key += len(self)
1358
+ if key < 0 or key >= len(self):
1359
+ raise IndexError('slice index out of range')
1360
+ return _api.Slice_uint64_elem(self.handle, key)
1361
+ else:
1362
+ raise TypeError('slice index invalid type')
1363
+ def __setitem__(self, idx, value):
1364
+ if idx < 0:
1365
+ idx += len(self)
1366
+ if idx < len(self):
1367
+ _api.Slice_uint64_set(self.handle, idx, value)
1368
+ return
1369
+ raise IndexError('slice index out of range')
1370
+ def __iadd__(self, value):
1371
+ if not isinstance(value, _collections_abc.Iterable):
1372
+ raise TypeError('Slice_uint64.__iadd__ takes a sequence as argument')
1373
+ for elt in value:
1374
+ self.append(elt)
1375
+ return self
1376
+ def __iter__(self):
1377
+ self.index = 0
1378
+ return self
1379
+ def __next__(self):
1380
+ if self.index < len(self):
1381
+ rv = _api.Slice_uint64_elem(self.handle, self.index)
1382
+ self.index = self.index + 1
1383
+ return rv
1384
+ raise StopIteration
1385
+ def append(self, value):
1386
+ _api.Slice_uint64_append(self.handle, value)
1387
+ def copy(self, src):
1388
+ """ copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
1389
+ mx = min(len(self), len(src))
1390
+ for i in range(mx):
1391
+ self[i] = src[i]
1392
+
1393
+ # Python type for slice []uint8
1394
+ class Slice_uint8(GoClass):
1395
+ """"""
1396
+ def __init__(self, *args, **kwargs):
1397
+ """
1398
+ handle=A Go-side object is always initialized with an explicit handle=arg
1399
+ otherwise parameter is a python list that we copy from
1400
+ """
1401
+ self.index = 0
1402
+ if len(kwargs) == 1 and 'handle' in kwargs:
1403
+ self.handle = kwargs['handle']
1404
+ _api.IncRef(self.handle)
1405
+ elif len(args) == 1 and isinstance(args[0], GoClass):
1406
+ self.handle = args[0].handle
1407
+ _api.IncRef(self.handle)
1408
+ else:
1409
+ self.handle = _api.Slice_uint8_CTor()
1410
+ _api.IncRef(self.handle)
1411
+ if len(args) > 0:
1412
+ if not isinstance(args[0], _collections_abc.Iterable):
1413
+ raise TypeError('Slice_uint8.__init__ takes a sequence as argument')
1414
+ for elt in args[0]:
1415
+ self.append(elt)
1416
+ def __del__(self):
1417
+ _api.DecRef(self.handle)
1418
+ def __str__(self):
1419
+ s = 'go.Slice_uint8 len: ' + str(len(self)) + ' handle: ' + str(self.handle) + ' ['
1420
+ if len(self) < 120:
1421
+ s += ', '.join(map(str, self)) + ']'
1422
+ return s
1423
+ def __repr__(self):
1424
+ return 'go.Slice_uint8([' + ', '.join(map(str, self)) + '])'
1425
+ def __len__(self):
1426
+ return _api.Slice_uint8_len(self.handle)
1427
+ def __getitem__(self, key):
1428
+ if isinstance(key, slice):
1429
+ if key.step == None or key.step == 1:
1430
+ st = key.start
1431
+ ed = key.stop
1432
+ if st == None:
1433
+ st = 0
1434
+ if ed == None:
1435
+ ed = _api.Slice_uint8_len(self.handle)
1436
+ return Slice_uint8(handle=_api.Slice_uint8_subslice(self.handle, st, ed))
1437
+ return [self[ii] for ii in range(*key.indices(len(self)))]
1438
+ elif isinstance(key, int):
1439
+ if key < 0:
1440
+ key += len(self)
1441
+ if key < 0 or key >= len(self):
1442
+ raise IndexError('slice index out of range')
1443
+ return _api.Slice_uint8_elem(self.handle, key)
1444
+ else:
1445
+ raise TypeError('slice index invalid type')
1446
+ def __setitem__(self, idx, value):
1447
+ if idx < 0:
1448
+ idx += len(self)
1449
+ if idx < len(self):
1450
+ _api.Slice_uint8_set(self.handle, idx, value)
1451
+ return
1452
+ raise IndexError('slice index out of range')
1453
+ def __iadd__(self, value):
1454
+ if not isinstance(value, _collections_abc.Iterable):
1455
+ raise TypeError('Slice_uint8.__iadd__ takes a sequence as argument')
1456
+ for elt in value:
1457
+ self.append(elt)
1458
+ return self
1459
+ def __iter__(self):
1460
+ self.index = 0
1461
+ return self
1462
+ def __next__(self):
1463
+ if self.index < len(self):
1464
+ rv = _api.Slice_uint8_elem(self.handle, self.index)
1465
+ self.index = self.index + 1
1466
+ return rv
1467
+ raise StopIteration
1468
+ def append(self, value):
1469
+ _api.Slice_uint8_append(self.handle, value)
1470
+ def copy(self, src):
1471
+ """ copy emulates the go copy function, copying elements into this list from source list, up to min of size of each list """
1472
+ mx = min(len(self), len(src))
1473
+ for i in range(mx):
1474
+ self[i] = src[i]
1475
+
1476
+ # ---- External Types Outside of Targeted Packages ---
1477
+
1478
+ # Python type for *environment.Class
1479
+ class Ptr_environment_Class(GoClass):
1480
+ """"""
1481
+ def __init__(self, *args, **kwargs):
1482
+ """
1483
+ handle=A Go-side object is always initialized with an explicit handle=arg
1484
+ """
1485
+ if len(kwargs) == 1 and 'handle' in kwargs:
1486
+ self.handle = kwargs['handle']
1487
+ _api.IncRef(self.handle)
1488
+ elif len(args) == 1 and isinstance(args[0], GoClass):
1489
+ self.handle = args[0].handle
1490
+ _api.IncRef(self.handle)
1491
+ elif len(args) == 1 and isinstance(args[0], int):
1492
+ self.handle = args[0]
1493
+ _api.IncRef(self.handle)
1494
+ else:
1495
+ self.handle = 0
1496
+ def __del__(self):
1497
+ _api.DecRef(self.handle)
1498
+
1499
+
1500
+ # Python type for *environment.Environment
1501
+ class Ptr_environment_Environment(GoClass):
1502
+ """"""
1503
+ def __init__(self, *args, **kwargs):
1504
+ """
1505
+ handle=A Go-side object is always initialized with an explicit handle=arg
1506
+ """
1507
+ if len(kwargs) == 1 and 'handle' in kwargs:
1508
+ self.handle = kwargs['handle']
1509
+ _api.IncRef(self.handle)
1510
+ elif len(args) == 1 and isinstance(args[0], GoClass):
1511
+ self.handle = args[0].handle
1512
+ _api.IncRef(self.handle)
1513
+ elif len(args) == 1 and isinstance(args[0], int):
1514
+ self.handle = args[0]
1515
+ _api.IncRef(self.handle)
1516
+ else:
1517
+ self.handle = 0
1518
+ def __del__(self):
1519
+ _api.DecRef(self.handle)
1520
+
1521
+
1522
+ # Python type for *environment.Function
1523
+ class Ptr_environment_Function(GoClass):
1524
+ """"""
1525
+ def __init__(self, *args, **kwargs):
1526
+ """
1527
+ handle=A Go-side object is always initialized with an explicit handle=arg
1528
+ """
1529
+ if len(kwargs) == 1 and 'handle' in kwargs:
1530
+ self.handle = kwargs['handle']
1531
+ _api.IncRef(self.handle)
1532
+ elif len(args) == 1 and isinstance(args[0], GoClass):
1533
+ self.handle = args[0].handle
1534
+ _api.IncRef(self.handle)
1535
+ elif len(args) == 1 and isinstance(args[0], int):
1536
+ self.handle = args[0]
1537
+ _api.IncRef(self.handle)
1538
+ else:
1539
+ self.handle = 0
1540
+ def __del__(self):
1541
+ _api.DecRef(self.handle)
1542
+
1543
+
1544
+ # Python type for *environment.MemberVariable
1545
+ class Ptr_environment_MemberVariable(GoClass):
1546
+ """"""
1547
+ def __init__(self, *args, **kwargs):
1548
+ """
1549
+ handle=A Go-side object is always initialized with an explicit handle=arg
1550
+ """
1551
+ if len(kwargs) == 1 and 'handle' in kwargs:
1552
+ self.handle = kwargs['handle']
1553
+ _api.IncRef(self.handle)
1554
+ elif len(args) == 1 and isinstance(args[0], GoClass):
1555
+ self.handle = args[0].handle
1556
+ _api.IncRef(self.handle)
1557
+ elif len(args) == 1 and isinstance(args[0], int):
1558
+ self.handle = args[0]
1559
+ _api.IncRef(self.handle)
1560
+ else:
1561
+ self.handle = 0
1562
+ def __del__(self):
1563
+ _api.DecRef(self.handle)
1564
+
1565
+
1566
+ # Python type for *environment.ObjectInstance
1567
+ class Ptr_environment_ObjectInstance(GoClass):
1568
+ """"""
1569
+ def __init__(self, *args, **kwargs):
1570
+ """
1571
+ handle=A Go-side object is always initialized with an explicit handle=arg
1572
+ """
1573
+ if len(kwargs) == 1 and 'handle' in kwargs:
1574
+ self.handle = kwargs['handle']
1575
+ _api.IncRef(self.handle)
1576
+ elif len(args) == 1 and isinstance(args[0], GoClass):
1577
+ self.handle = args[0].handle
1578
+ _api.IncRef(self.handle)
1579
+ elif len(args) == 1 and isinstance(args[0], int):
1580
+ self.handle = args[0]
1581
+ _api.IncRef(self.handle)
1582
+ else:
1583
+ self.handle = 0
1584
+ def __del__(self):
1585
+ _api.DecRef(self.handle)
1586
+
1587
+
1588
+ # Python type for *environment.Variable
1589
+ class Ptr_environment_Variable(GoClass):
1590
+ """"""
1591
+ def __init__(self, *args, **kwargs):
1592
+ """
1593
+ handle=A Go-side object is always initialized with an explicit handle=arg
1594
+ """
1595
+ if len(kwargs) == 1 and 'handle' in kwargs:
1596
+ self.handle = kwargs['handle']
1597
+ _api.IncRef(self.handle)
1598
+ elif len(args) == 1 and isinstance(args[0], GoClass):
1599
+ self.handle = args[0].handle
1600
+ _api.IncRef(self.handle)
1601
+ elif len(args) == 1 and isinstance(args[0], int):
1602
+ self.handle = args[0]
1603
+ _api.IncRef(self.handle)
1604
+ else:
1605
+ self.handle = 0
1606
+ def __del__(self):
1607
+ _api.DecRef(self.handle)
1608
+
1609
+
1610
+ # Python type for context.Context
1611
+ class context_Context(GoClass):
1612
+ """"""
1613
+ def __init__(self, *args, **kwargs):
1614
+ """
1615
+ handle=A Go-side object is always initialized with an explicit handle=arg
1616
+ """
1617
+ if len(kwargs) == 1 and 'handle' in kwargs:
1618
+ self.handle = kwargs['handle']
1619
+ _api.IncRef(self.handle)
1620
+ elif len(args) == 1 and isinstance(args[0], GoClass):
1621
+ self.handle = args[0].handle
1622
+ _api.IncRef(self.handle)
1623
+ elif len(args) == 1 and isinstance(args[0], int):
1624
+ self.handle = args[0]
1625
+ _api.IncRef(self.handle)
1626
+ else:
1627
+ self.handle = 0
1628
+ def __del__(self):
1629
+ _api.DecRef(self.handle)
1630
+
1631
+
1632
+ # Python type for environment.Class
1633
+ class environment_Class(GoClass):
1634
+ """"""
1635
+ def __init__(self, *args, **kwargs):
1636
+ """
1637
+ handle=A Go-side object is always initialized with an explicit handle=arg
1638
+ """
1639
+ if len(kwargs) == 1 and 'handle' in kwargs:
1640
+ self.handle = kwargs['handle']
1641
+ _api.IncRef(self.handle)
1642
+ elif len(args) == 1 and isinstance(args[0], GoClass):
1643
+ self.handle = args[0].handle
1644
+ _api.IncRef(self.handle)
1645
+ elif len(args) == 1 and isinstance(args[0], int):
1646
+ self.handle = args[0]
1647
+ _api.IncRef(self.handle)
1648
+ else:
1649
+ self.handle = 0
1650
+ def __del__(self):
1651
+ _api.DecRef(self.handle)
1652
+
1653
+
1654
+ # Python type for environment.Environment
1655
+ class environment_Environment(GoClass):
1656
+ """"""
1657
+ def __init__(self, *args, **kwargs):
1658
+ """
1659
+ handle=A Go-side object is always initialized with an explicit handle=arg
1660
+ """
1661
+ if len(kwargs) == 1 and 'handle' in kwargs:
1662
+ self.handle = kwargs['handle']
1663
+ _api.IncRef(self.handle)
1664
+ elif len(args) == 1 and isinstance(args[0], GoClass):
1665
+ self.handle = args[0].handle
1666
+ _api.IncRef(self.handle)
1667
+ elif len(args) == 1 and isinstance(args[0], int):
1668
+ self.handle = args[0]
1669
+ _api.IncRef(self.handle)
1670
+ else:
1671
+ self.handle = 0
1672
+ def __del__(self):
1673
+ _api.DecRef(self.handle)
1674
+
1675
+
1676
+ # Python type for environment.Function
1677
+ class environment_Function(GoClass):
1678
+ """"""
1679
+ def __init__(self, *args, **kwargs):
1680
+ """
1681
+ handle=A Go-side object is always initialized with an explicit handle=arg
1682
+ """
1683
+ if len(kwargs) == 1 and 'handle' in kwargs:
1684
+ self.handle = kwargs['handle']
1685
+ _api.IncRef(self.handle)
1686
+ elif len(args) == 1 and isinstance(args[0], GoClass):
1687
+ self.handle = args[0].handle
1688
+ _api.IncRef(self.handle)
1689
+ elif len(args) == 1 and isinstance(args[0], int):
1690
+ self.handle = args[0]
1691
+ _api.IncRef(self.handle)
1692
+ else:
1693
+ self.handle = 0
1694
+ def __del__(self):
1695
+ _api.DecRef(self.handle)
1696
+
1697
+
1698
+ # Python type for environment.MemberVariable
1699
+ class environment_MemberVariable(GoClass):
1700
+ """"""
1701
+ def __init__(self, *args, **kwargs):
1702
+ """
1703
+ handle=A Go-side object is always initialized with an explicit handle=arg
1704
+ """
1705
+ if len(kwargs) == 1 and 'handle' in kwargs:
1706
+ self.handle = kwargs['handle']
1707
+ _api.IncRef(self.handle)
1708
+ elif len(args) == 1 and isinstance(args[0], GoClass):
1709
+ self.handle = args[0].handle
1710
+ _api.IncRef(self.handle)
1711
+ elif len(args) == 1 and isinstance(args[0], int):
1712
+ self.handle = args[0]
1713
+ _api.IncRef(self.handle)
1714
+ else:
1715
+ self.handle = 0
1716
+ def __del__(self):
1717
+ _api.DecRef(self.handle)
1718
+
1719
+
1720
+ # Python type for environment.ObjectInstance
1721
+ class environment_ObjectInstance(GoClass):
1722
+ """"""
1723
+ def __init__(self, *args, **kwargs):
1724
+ """
1725
+ handle=A Go-side object is always initialized with an explicit handle=arg
1726
+ """
1727
+ if len(kwargs) == 1 and 'handle' in kwargs:
1728
+ self.handle = kwargs['handle']
1729
+ _api.IncRef(self.handle)
1730
+ elif len(args) == 1 and isinstance(args[0], GoClass):
1731
+ self.handle = args[0].handle
1732
+ _api.IncRef(self.handle)
1733
+ elif len(args) == 1 and isinstance(args[0], int):
1734
+ self.handle = args[0]
1735
+ _api.IncRef(self.handle)
1736
+ else:
1737
+ self.handle = 0
1738
+ def __del__(self):
1739
+ _api.DecRef(self.handle)
1740
+
1741
+
1742
+ # Python type for environment.Parameter
1743
+ class environment_Parameter(GoClass):
1744
+ """"""
1745
+ def __init__(self, *args, **kwargs):
1746
+ """
1747
+ handle=A Go-side object is always initialized with an explicit handle=arg
1748
+ """
1749
+ if len(kwargs) == 1 and 'handle' in kwargs:
1750
+ self.handle = kwargs['handle']
1751
+ _api.IncRef(self.handle)
1752
+ elif len(args) == 1 and isinstance(args[0], GoClass):
1753
+ self.handle = args[0].handle
1754
+ _api.IncRef(self.handle)
1755
+ elif len(args) == 1 and isinstance(args[0], int):
1756
+ self.handle = args[0]
1757
+ _api.IncRef(self.handle)
1758
+ else:
1759
+ self.handle = 0
1760
+ def __del__(self):
1761
+ _api.DecRef(self.handle)
1762
+
1763
+
1764
+ # Python type for environment.Value
1765
+ class environment_Value(GoClass):
1766
+ """"""
1767
+ def __init__(self, *args, **kwargs):
1768
+ """
1769
+ handle=A Go-side object is always initialized with an explicit handle=arg
1770
+ """
1771
+ if len(kwargs) == 1 and 'handle' in kwargs:
1772
+ self.handle = kwargs['handle']
1773
+ _api.IncRef(self.handle)
1774
+ elif len(args) == 1 and isinstance(args[0], GoClass):
1775
+ self.handle = args[0].handle
1776
+ _api.IncRef(self.handle)
1777
+ elif len(args) == 1 and isinstance(args[0], int):
1778
+ self.handle = args[0]
1779
+ _api.IncRef(self.handle)
1780
+ else:
1781
+ self.handle = 0
1782
+ def __del__(self):
1783
+ _api.DecRef(self.handle)
1784
+
1785
+
1786
+ # Python type for environment.Variable
1787
+ class environment_Variable(GoClass):
1788
+ """"""
1789
+ def __init__(self, *args, **kwargs):
1790
+ """
1791
+ handle=A Go-side object is always initialized with an explicit handle=arg
1792
+ """
1793
+ if len(kwargs) == 1 and 'handle' in kwargs:
1794
+ self.handle = kwargs['handle']
1795
+ _api.IncRef(self.handle)
1796
+ elif len(args) == 1 and isinstance(args[0], GoClass):
1797
+ self.handle = args[0].handle
1798
+ _api.IncRef(self.handle)
1799
+ elif len(args) == 1 and isinstance(args[0], int):
1800
+ self.handle = args[0]
1801
+ _api.IncRef(self.handle)
1802
+ else:
1803
+ self.handle = 0
1804
+ def __del__(self):
1805
+ _api.DecRef(self.handle)
1806
+
1807
+
1808
+ # Python type for io.Reader
1809
+ class io_Reader(GoClass):
1810
+ """"""
1811
+ def __init__(self, *args, **kwargs):
1812
+ """
1813
+ handle=A Go-side object is always initialized with an explicit handle=arg
1814
+ """
1815
+ if len(kwargs) == 1 and 'handle' in kwargs:
1816
+ self.handle = kwargs['handle']
1817
+ _api.IncRef(self.handle)
1818
+ elif len(args) == 1 and isinstance(args[0], GoClass):
1819
+ self.handle = args[0].handle
1820
+ _api.IncRef(self.handle)
1821
+ elif len(args) == 1 and isinstance(args[0], int):
1822
+ self.handle = args[0]
1823
+ _api.IncRef(self.handle)
1824
+ else:
1825
+ self.handle = 0
1826
+ def __del__(self):
1827
+ _api.DecRef(self.handle)
1828
+
1829
+
1830
+ # Python type for io.Writer
1831
+ class io_Writer(GoClass):
1832
+ """"""
1833
+ def __init__(self, *args, **kwargs):
1834
+ """
1835
+ handle=A Go-side object is always initialized with an explicit handle=arg
1836
+ """
1837
+ if len(kwargs) == 1 and 'handle' in kwargs:
1838
+ self.handle = kwargs['handle']
1839
+ _api.IncRef(self.handle)
1840
+ elif len(args) == 1 and isinstance(args[0], GoClass):
1841
+ self.handle = args[0].handle
1842
+ _api.IncRef(self.handle)
1843
+ elif len(args) == 1 and isinstance(args[0], int):
1844
+ self.handle = args[0]
1845
+ _api.IncRef(self.handle)
1846
+ else:
1847
+ self.handle = 0
1848
+ def __del__(self):
1849
+ _api.DecRef(self.handle)
1850
+
1851
+
1852
+