Skip to content

Commit f5e990c

Browse files
committed
Update Stubs
1 parent 044450e commit f5e990c

3 files changed

Lines changed: 36 additions & 0 deletions

File tree

  • tests/stubs
    • python-3.11/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings
    • python-3.12/pybind11-v3.0
      • numpy-array-use-type-var/demo/_bindings
      • numpy-array-wrap-with-annotated/demo/_bindings

tests/stubs/python-3.11/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
from __future__ import annotations
22

3+
import enum
34
import typing
45

56
__all__: list[str] = [
67
"Blue",
78
"ConsoleForegroundColor",
89
"Green",
910
"Magenta",
11+
"NativeColor",
1012
"None_",
1113
"Yellow",
1214
"accept_defaulted_enum",
@@ -62,6 +64,16 @@ class ConsoleForegroundColor:
6264
@property
6365
def value(self) -> int: ...
6466

67+
class NativeColor(enum.IntEnum):
68+
"""
69+
An enumeration.
70+
"""
71+
72+
Blue: typing.ClassVar[NativeColor] # value = <NativeColor.Blue: 2>
73+
Red: typing.ClassVar[NativeColor] # value = <NativeColor.Red: 1>
74+
@classmethod
75+
def __new__(cls, value): ...
76+
6577
def accept_defaulted_enum(
6678
color: ConsoleForegroundColor = ConsoleForegroundColor.None_,
6779
) -> None: ...

tests/stubs/python-3.12/pybind11-v3.0/numpy-array-use-type-var/demo/_bindings/enum.pyi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
from __future__ import annotations
22

3+
import enum
34
import typing
45

56
__all__: list[str] = [
67
"Blue",
78
"ConsoleForegroundColor",
89
"Green",
910
"Magenta",
11+
"NativeColor",
1012
"None_",
1113
"Yellow",
1214
"accept_defaulted_enum",
@@ -62,6 +64,16 @@ class ConsoleForegroundColor:
6264
@property
6365
def value(self) -> int: ...
6466

67+
class NativeColor(enum.IntEnum):
68+
Blue: typing.ClassVar[NativeColor] # value = <NativeColor.Blue: 2>
69+
Red: typing.ClassVar[NativeColor] # value = <NativeColor.Red: 1>
70+
@classmethod
71+
def __new__(cls, value): ...
72+
def __format__(self, format_spec):
73+
"""
74+
Convert to a string according to format_spec.
75+
"""
76+
6577
def accept_defaulted_enum(
6678
color: ConsoleForegroundColor = ConsoleForegroundColor.None_,
6779
) -> None: ...

tests/stubs/python-3.12/pybind11-v3.0/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
from __future__ import annotations
22

3+
import enum
34
import typing
45

56
__all__: list[str] = [
67
"Blue",
78
"ConsoleForegroundColor",
89
"Green",
910
"Magenta",
11+
"NativeColor",
1012
"None_",
1113
"Yellow",
1214
"accept_defaulted_enum",
@@ -62,6 +64,16 @@ class ConsoleForegroundColor:
6264
@property
6365
def value(self) -> int: ...
6466

67+
class NativeColor(enum.IntEnum):
68+
Blue: typing.ClassVar[NativeColor] # value = <NativeColor.Blue: 2>
69+
Red: typing.ClassVar[NativeColor] # value = <NativeColor.Red: 1>
70+
@classmethod
71+
def __new__(cls, value): ...
72+
def __format__(self, format_spec):
73+
"""
74+
Convert to a string according to format_spec.
75+
"""
76+
6577
def accept_defaulted_enum(
6678
color: ConsoleForegroundColor = ConsoleForegroundColor.None_,
6779
) -> None: ...

0 commit comments

Comments
 (0)