Skip to content

Commit c57778a

Browse files
committed
Update silver files
1 parent 4fb61d3 commit c57778a

43 files changed

Lines changed: 575 additions & 601 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/aliases/__init__.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ __all__: list[str] = [
3838
"random",
3939
]
4040

41-
class Color:
42-
pass
43-
4441
class Dummy:
4542
linalg = numpy.linalg
4643

44+
class Color:
45+
pass
46+
4747
def foreign_enum_default(
4848
color: typing.Any = demo._bindings.enum.ConsoleForegroundColor.Blue,
4949
) -> None: ...
5050
def func(arg0: int) -> int: ...
5151

52-
local_func_alias = func
5352
local_type_alias = Color
53+
local_func_alias = func

tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,7 @@ from __future__ import annotations
22

33
import typing
44

5-
__all__: list[str] = ["Base", "CppException", "Derived", "Foo", "Outer"]
6-
7-
class Base:
8-
class Inner:
9-
pass
10-
name: str
11-
12-
class CppException(Exception):
13-
pass
14-
15-
class Derived(Base):
16-
count: int
17-
18-
class Foo:
19-
class FooChild:
20-
def __init__(self) -> None: ...
21-
def g(self) -> None: ...
22-
23-
def __init__(self) -> None: ...
24-
def f(self) -> None: ...
5+
__all__: list[str] = ["CppException", "Derived", "Foo", "MyBase", "Outer"]
256

267
class Outer:
278
class Inner:
@@ -55,3 +36,22 @@ class Outer:
5536
def value(self) -> int: ...
5637
value: Outer.Inner.NestedEnum
5738
inner: Outer.Inner
39+
40+
class MyBase:
41+
class Inner:
42+
pass
43+
name: str
44+
45+
class Derived(MyBase):
46+
count: int
47+
48+
class Foo:
49+
class FooChild:
50+
def __init__(self) -> None: ...
51+
def g(self) -> None: ...
52+
53+
def __init__(self) -> None: ...
54+
def f(self) -> None: ...
55+
56+
class CppException(Exception):
57+
pass

tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ __all__: list[str] = [
1010
"get_unbound_type",
1111
]
1212

13-
class Enum:
13+
class Unbound:
1414
pass
1515

16-
class Unbound:
16+
class Enum:
1717
pass
1818

1919
def accept_unbound_enum(arg0: ...) -> int: ...

tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/functions.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import typing
55
__all__: list[str] = [
66
"Foo",
77
"accept_callable",
8-
"accept_frozenset",
98
"accept_py_handle",
109
"accept_py_object",
1110
"accept_set",
@@ -28,7 +27,6 @@ class Foo:
2827
def __init__(self, arg0: int) -> None: ...
2928

3029
def accept_callable(arg0: typing.Callable) -> typing.Any: ...
31-
def accept_frozenset(arg0: frozenset) -> None: ...
3230
def accept_py_handle(arg0: typing.Any) -> str: ...
3331
def accept_py_object(arg0: typing.Any) -> str: ...
3432
def accept_set(arg0: set) -> None: ...

tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/properties.pyi

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,23 @@ __all__: list[str] = [
99
"WithoutDoc",
1010
]
1111

12-
class WithGetterSetterDoc:
12+
class WithoutDoc:
1313
"""
14-
User docstring provided via pybind11::cpp_function(..., doc) to getters/setters, but NOT to `def_*(..., doc)` calls
14+
No user docstring provided
1515
"""
1616

1717
def_property_readonly_static: typing.ClassVar[int] = 0
1818
def_property_static: typing.ClassVar[int] = 0
19+
def_property: int
20+
def_readwrite: int
1921
@property
20-
def def_property(self) -> int:
21-
"""
22-
getter doc token
23-
"""
24-
@def_property.setter
25-
def def_property(self, arg1: int) -> None:
26-
"""
27-
setter doc token
28-
"""
22+
def def_property_readonly(self) -> int: ...
2923
@property
30-
def def_property_readonly(self) -> int:
31-
"""
32-
getter doc token
33-
"""
24+
def def_readonly(self) -> int: ...
3425

35-
class WithPropAndGetterSetterDoc:
26+
class WithPropDoc:
3627
"""
37-
User docstring provided via pybind11::cpp_function(..., doc) to getters/setters and to `def_*(, doc)` calls
28+
User docstring provided only to `def_` calls
3829
"""
3930

4031
def_property_readonly_static: typing.ClassVar[int] = 0
@@ -51,49 +42,58 @@ class WithPropAndGetterSetterDoc:
5142
"""
5243
prop doc token
5344
"""
45+
@property
46+
def def_readonly(self) -> int:
47+
"""
48+
prop doc token
49+
"""
50+
@property
51+
def def_readwrite(self) -> int:
52+
"""
53+
prop doc token
54+
"""
55+
@def_readwrite.setter
56+
def def_readwrite(self, arg0: int) -> None: ...
5457

55-
class WithPropDoc:
58+
class WithGetterSetterDoc:
5659
"""
57-
User docstring provided only to `def_` calls
60+
User docstring provided via pybind11::cpp_function(..., doc) to getters/setters, but NOT to `def_*(..., doc)` calls
5861
"""
5962

6063
def_property_readonly_static: typing.ClassVar[int] = 0
6164
def_property_static: typing.ClassVar[int] = 0
6265
@property
6366
def def_property(self) -> int:
6467
"""
65-
prop doc token
68+
getter doc token
6669
"""
6770
@def_property.setter
68-
def def_property(self, arg1: int) -> None: ...
69-
@property
70-
def def_property_readonly(self) -> int:
71-
"""
72-
prop doc token
73-
"""
74-
@property
75-
def def_readonly(self) -> int:
71+
def def_property(self, arg1: int) -> None:
7672
"""
77-
prop doc token
73+
setter doc token
7874
"""
7975
@property
80-
def def_readwrite(self) -> int:
76+
def def_property_readonly(self) -> int:
8177
"""
82-
prop doc token
78+
getter doc token
8379
"""
84-
@def_readwrite.setter
85-
def def_readwrite(self, arg0: int) -> None: ...
8680

87-
class WithoutDoc:
81+
class WithPropAndGetterSetterDoc:
8882
"""
89-
No user docstring provided
83+
User docstring provided via pybind11::cpp_function(..., doc) to getters/setters and to `def_*(, doc)` calls
9084
"""
9185

9286
def_property_readonly_static: typing.ClassVar[int] = 0
9387
def_property_static: typing.ClassVar[int] = 0
94-
def_property: int
95-
def_readwrite: int
9688
@property
97-
def def_property_readonly(self) -> int: ...
89+
def def_property(self) -> int:
90+
"""
91+
prop doc token
92+
"""
93+
@def_property.setter
94+
def def_property(self, arg1: int) -> None: ...
9895
@property
99-
def def_readonly(self) -> int: ...
96+
def def_property_readonly(self) -> int:
97+
"""
98+
prop doc token
99+
"""

tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/stl.pyi

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ from __future__ import annotations
22

33
import typing
44

5-
import pybind11_stubgen.typing_ext
6-
75
__all__: list[str] = [
86
"std_array",
97
"std_map",
@@ -12,9 +10,7 @@ __all__: list[str] = [
1210
"std_vector",
1311
]
1412

15-
def std_array(
16-
arg0: typing.Annotated[list[int], pybind11_stubgen.typing_ext.FixedSize(3)]
17-
) -> typing.Annotated[list[int], pybind11_stubgen.typing_ext.FixedSize(3)]: ...
13+
def std_array(arg0: list[int[3]]) -> list[int[3]]: ...
1814
def std_map() -> dict[int, complex]: ...
1915
def std_optional(arg0: int | None) -> None: ...
2016
def std_variant(arg0: int | float | tuple[int, int]) -> None: ...

tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/stl_bind.pyi

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,6 @@ __all__: list[str] = [
99
"get_vector_of_pairs",
1010
]
1111

12-
class MapStringComplex:
13-
def __bool__(self) -> bool:
14-
"""
15-
Check whether the map is nonempty
16-
"""
17-
@typing.overload
18-
def __contains__(self, arg0: str) -> bool: ...
19-
@typing.overload
20-
def __contains__(self, arg0: typing.Any) -> bool: ...
21-
def __delitem__(self, arg0: str) -> None: ...
22-
def __getitem__(self, arg0: str) -> complex: ...
23-
def __init__(self) -> None: ...
24-
def __iter__(self) -> typing.Iterator: ...
25-
def __len__(self) -> int: ...
26-
def __repr__(self) -> str:
27-
"""
28-
Return the canonical string representation of this map.
29-
"""
30-
def __setitem__(self, arg0: str, arg1: complex) -> None: ...
31-
def items(self) -> typing.ItemsView[str, complex]: ...
32-
def keys(self) -> typing.KeysView[str]: ...
33-
def values(self) -> typing.ValuesView[complex]: ...
34-
3512
class VectorPairStringDouble:
3613
__hash__: typing.ClassVar[None] = None
3714
def __bool__(self) -> bool:
@@ -120,5 +97,28 @@ class VectorPairStringDouble:
12097
Remove the first item from the list whose value is x. It is an error if there is no such item.
12198
"""
12299

100+
class MapStringComplex:
101+
def __bool__(self) -> bool:
102+
"""
103+
Check whether the map is nonempty
104+
"""
105+
@typing.overload
106+
def __contains__(self, arg0: str) -> bool: ...
107+
@typing.overload
108+
def __contains__(self, arg0: typing.Any) -> bool: ...
109+
def __delitem__(self, arg0: str) -> None: ...
110+
def __getitem__(self, arg0: str) -> complex: ...
111+
def __init__(self) -> None: ...
112+
def __iter__(self) -> typing.Iterator: ...
113+
def __len__(self) -> int: ...
114+
def __repr__(self) -> str:
115+
"""
116+
Return the canonical string representation of this map.
117+
"""
118+
def __setitem__(self, arg0: str, arg1: complex) -> None: ...
119+
def items(self) -> typing.ItemsView[MapStringComplex]: ...
120+
def keys(self) -> typing.KeysView[MapStringComplex]: ...
121+
def values(self) -> typing.ValuesView[MapStringComplex]: ...
122+
123123
def get_complex_map() -> MapStringComplex: ...
124124
def get_vector_of_pairs() -> VectorPairStringDouble: ...

tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/aliases/__init__.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ __all__: list[str] = [
3838
"random",
3939
]
4040

41-
class Color:
42-
pass
43-
4441
class Dummy:
4542
linalg = numpy.linalg
4643

44+
class Color:
45+
pass
46+
4747
def foreign_enum_default(
4848
color: typing.Any = demo._bindings.enum.ConsoleForegroundColor.Blue,
4949
) -> None: ...
5050
def func(arg0: int) -> int: ...
5151

52-
local_func_alias = func
5352
local_type_alias = Color
53+
local_func_alias = func

tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,7 @@ from __future__ import annotations
22

33
import typing
44

5-
__all__: list[str] = ["Base", "CppException", "Derived", "Foo", "Outer"]
6-
7-
class Base:
8-
class Inner:
9-
pass
10-
name: str
11-
12-
class CppException(Exception):
13-
pass
14-
15-
class Derived(Base):
16-
count: int
17-
18-
class Foo:
19-
class FooChild:
20-
def __init__(self) -> None: ...
21-
def g(self) -> None: ...
22-
23-
def __init__(self) -> None: ...
24-
def f(self) -> None: ...
5+
__all__: list[str] = ["CppException", "Derived", "Foo", "MyBase", "Outer"]
256

267
class Outer:
278
class Inner:
@@ -55,3 +36,22 @@ class Outer:
5536
def value(self) -> int: ...
5637
value: Outer.Inner.NestedEnum
5738
inner: Outer.Inner
39+
40+
class MyBase:
41+
class Inner:
42+
pass
43+
name: str
44+
45+
class Derived(MyBase):
46+
count: int
47+
48+
class Foo:
49+
class FooChild:
50+
def __init__(self) -> None: ...
51+
def g(self) -> None: ...
52+
53+
def __init__(self) -> None: ...
54+
def f(self) -> None: ...
55+
56+
class CppException(Exception):
57+
pass

tests/stubs/python-3.12/pybind11-v2.12/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ __all__: list[str] = [
1010
"get_unbound_type",
1111
]
1212

13-
class Enum:
13+
class Unbound:
1414
pass
1515

16-
class Unbound:
16+
class Enum:
1717
pass
1818

1919
def accept_unbound_enum(arg0: ...) -> int: ...

0 commit comments

Comments
 (0)