File: test_classes_ext.pyi.ref

package info (click to toggle)
nanobind 2.9.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,060 kB
  • sloc: cpp: 11,838; python: 5,862; ansic: 4,820; makefile: 22; sh: 15
file content (362 lines) | stat: -rw-r--r-- 7,172 bytes parent folder | download
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
from typing import overload


class Struct:
    """Some documentation"""

    @overload
    def __init__(self) -> None: ...

    @overload
    def __init__(self, arg: int, /) -> None: ...

    def value(self) -> int: ...

    def set_value(self, value: int) -> None: ...

    def self(self) -> Struct: ...

    def none(self) -> Struct: ...

    def __getstate__(self) -> int: ...

    def __setstate__(self, arg: int, /) -> None: ...

    @overload
    @staticmethod
    def static_test(arg: int, /) -> int: ...

    @overload
    @staticmethod
    def static_test(arg: float, /) -> int: ...

    @staticmethod
    def create_move() -> Struct: ...

    @staticmethod
    def create_reference() -> Struct: ...

    @staticmethod
    def create_copy() -> Struct: ...

    @staticmethod
    def create_take() -> Struct: ...

class PairStruct:
    def __init__(self) -> None: ...

    @property
    def s1(self) -> Struct:
        """A documented property"""

    @s1.setter
    def s1(self, arg: Struct, /) -> None: ...

    @property
    def s2(self) -> Struct: ...

    @s2.setter
    def s2(self, arg: Struct, /) -> None: ...

def stats() -> dict: ...

def reset() -> None: ...

class Big:
    """
    A class
    with a multi-line
    docstring..
    """

    def __init__(self) -> None: ...

class BigAligned:
    def __init__(self) -> None: ...

class Animal:
    def __init__(self) -> None:
        """A constructor"""

    def name(self) -> str:
        """A method"""

    def what(self) -> str: ...

class Dog(Animal):
    def __init__(self, arg: str, /) -> None: ...

class Cat(Animal):
    def __init__(self, arg: str, /) -> None: ...

class SiameseCat(Cat):
    pass

def go(arg: Animal, /) -> str: ...

def animal_passthrough(arg: Animal, /) -> Animal: ...

def dog_passthrough(arg: Dog, /) -> Dog: ...

def void_ret(arg: Animal, /) -> None: ...

def call_function(arg: object, /) -> object: ...

def call_method(arg: object, /) -> object: ...

class Foo:
    pass

def i2p(arg: int, /) -> Foo: ...

def p2i(x: Foo | None = None) -> int: ...

class A:
    def __init__(self, arg: int, /) -> None: ...

class B:
    def __init__(self, arg: int, /) -> None: ...

class B2(B):
    def __init__(self, arg: int, /) -> None: ...

class C:
    def __init__(self, arg: int, /) -> None: ...

class D:
    @overload
    def __init__(self, arg: A, /) -> None: ...

    @overload
    def __init__(self, arg: B, /) -> None: ...

    @overload
    def __init__(self, arg: int, /) -> None: ...

    @overload
    def __init__(self, arg: float, /) -> None: ...

    @property
    def value(self) -> int: ...

    @value.setter
    def value(self, arg: int, /) -> None: ...

def get_d(arg: D, /) -> int: ...

def get_optional_d(arg: D | None) -> int: ...

def get_d_via_cast(arg: object, /) -> tuple: ...

def get_d_via_try_cast(arg: object, /) -> tuple: ...

class Int:
    def __init__(self, arg: int, /) -> None: ...

    def __add__(self, arg: Int, /) -> Int: ...

    def __iadd__(self, arg: Int, /) -> Int: ...

    def __sub__(self, arg: float, /) -> Int: ...

    def __repr__(self) -> str: ...

def keep_alive_arg(arg0: object, arg1: object, /) -> object: ...

def keep_alive_ret(arg0: object, arg1: object, /) -> object: ...

def f() -> None: ...

class MyClass:
    def __init__(self) -> None: ...

    class NestedClass:
        def f(self) -> None: ...

    def f(self) -> None: ...

class StaticProperties:
    value: int = ...
    """Static property docstring"""

    @staticmethod
    def get() -> int: ...

class StaticProperties2(StaticProperties):
    pass

class ClassWithSupplement:
    def __init__(self) -> None: ...

def check_supplement(arg: object, /) -> bool: ...

class ClassWithLen:
    def __init__(self) -> None: ...

    def __len__(self, /):
        """Return len(self)."""

def test_lowlevel() -> tuple: ...

def test_handle_t(arg: Struct, /) -> object: ...

def test_type_object_t(arg: type[Struct], /) -> object: ...

def none_0(arg: Struct, /) -> bool: ...

def none_1(arg: Struct) -> bool: ...

def none_2(arg: Struct) -> bool: ...

def none_3(arg: Struct | None) -> bool: ...

def none_4(arg: Struct | None) -> bool: ...

class FinalType:
    def __init__(self) -> None: ...

class StructWithAttr(Struct):
    def __init__(self, arg: int, /) -> None: ...

class Wrapper:
    def __init__(self) -> None: ...

    @property
    def value(self) -> Wrapper: ...

    @value.setter
    def value(self, arg: Wrapper, /) -> None: ...

class NonCopyableVec:
    pass

def is_int_1(arg: object, /) -> bool: ...

def is_int_2(arg: object, /) -> bool: ...

def is_struct(arg: object, /) -> bool: ...

class Base:
    pass

class Subclass:
    pass

class PolymorphicBase:
    pass

class PolymorphicSubclass:
    pass

def polymorphic_factory() -> PolymorphicBase: ...

def polymorphic_factory_2() -> PolymorphicBase: ...

def factory() -> Base: ...

def factory_2() -> Base: ...

def check_shared(arg: "Shared", /) -> None: ...

def try_cast_1(arg: object | None) -> tuple[bool, Struct]: ...

def try_cast_2(arg: object | None) -> tuple[bool, Struct]: ...

def try_cast_3(arg: object | None) -> tuple[bool, Struct]: ...

def try_cast_4(arg: object, /) -> tuple[bool, int]: ...

def test_slots() -> tuple: ...

class IncrementingStruct(Struct):
    def __init__(self, arg: Struct, /) -> None: ...

def get_destructed() -> list: ...

def get_incrementing_struct_value(arg: IncrementingStruct, /) -> Struct: ...

class StructWithWeakrefs(Struct):
    def __init__(self, arg: int, /) -> None: ...

class StructWithWeakrefsAndDynamicAttrs(Struct):
    def __init__(self, arg: int, /) -> None: ...

class Union:
    def __init__(self) -> None: ...

    @property
    def i(self) -> int: ...

    @i.setter
    def i(self, arg: int, /) -> None: ...

    @property
    def f(self) -> float: ...

    @f.setter
    def f(self, arg: float, /) -> None: ...

class BoundDerived:
    def __init__(self) -> None: ...

    @property
    def value(self) -> int: ...

    @value.setter
    def value(self, arg: int, /) -> None: ...

    @property
    def prop(self) -> int: ...

    @prop.setter
    def prop(self, arg: int, /) -> None: ...

    def get_answer(self) -> int: ...

    def polymorphic(self) -> int: ...

class UniqueInt:
    @overload
    def __init__(self, arg: int, /) -> None: ...

    @overload
    def __init__(self, s: str) -> None: ...

    def value(self) -> int: ...

    def lookups(self) -> int: ...

class NewNone:
    def __init__(self) -> None: ...

class NewDflt:
    def __init__(self, value: int = 42) -> None: ...

    @property
    def value(self) -> int: ...

class NewStar:
    def __init__(self, *args, value: int = 42, **kwargs) -> None: ...

    @property
    def value(self) -> int: ...

class MonkeyPatchable:
    def __init__(self) -> None: ...

    @staticmethod
    def custom_init(arg: MonkeyPatchable, /) -> None: ...

    @property
    def value(self) -> int: ...

    @value.setter
    def value(self, arg: int, /) -> None: ...

class StaticPropertyOverride:
    x: int = ...
    """(arg: object, /) -> int"""

class StaticPropertyOverride2(StaticPropertyOverride):
    x: int = ...
    """(arg: object, /) -> int"""