From 562ada4ce2ec24c964ba537e980228c19559e0c7 Mon Sep 17 00:00:00 2001 From: Sergei Izmailov Date: Sun, 26 Nov 2023 01:30:18 +0900 Subject: [PATCH] chore: Update stubs --- .../demo/_bindings/aliases/foreign_attr.pyi | 6 +- .../aliases/foreign_class_member.pyi | 4 +- .../demo/_bindings/classes.pyi | 14 ++++- .../demo/_bindings/duplicate_enum.pyi | 18 ++++-- .../demo/_bindings/eigen.pyi | 63 +++++++++++++++---- .../demo/_bindings/enum.pyi | 36 +++++++---- .../demo/_bindings/flawed_bindings.pyi | 36 +++++++++-- .../demo/_bindings/issues.pyi | 4 +- .../demo/_bindings/values.pyi | 15 +++-- .../demo/pure_python/functions.pyi | 10 ++- .../demo/pure_python/functions_3_8_plus.pyi | 2 +- .../demo/_bindings/aliases/foreign_attr.pyi | 6 +- .../aliases/foreign_class_member.pyi | 4 +- .../demo/_bindings/classes.pyi | 14 ++++- .../demo/_bindings/duplicate_enum.pyi | 18 ++++-- .../demo/_bindings/enum.pyi | 36 +++++++---- .../demo/_bindings/flawed_bindings.pyi | 36 +++++++++-- .../demo/_bindings/issues.pyi | 4 +- .../demo/_bindings/values.pyi | 15 +++-- .../demo/pure_python/functions.pyi | 10 ++- .../demo/pure_python/functions_3_8_plus.pyi | 2 +- .../demo/_bindings/aliases/foreign_attr.pyi | 6 +- .../aliases/foreign_class_member.pyi | 4 +- .../demo/_bindings/classes.pyi | 14 ++++- .../demo/_bindings/duplicate_enum.pyi | 18 ++++-- .../demo/_bindings/enum.pyi | 36 +++++++---- .../demo/_bindings/flawed_bindings.pyi | 36 +++++++++-- .../demo/_bindings/issues.pyi | 4 +- .../demo/_bindings/values.pyi | 15 +++-- .../demo/pure_python/functions.pyi | 10 ++- .../demo/pure_python/functions_3_8_plus.pyi | 2 +- .../demo/_bindings/aliases/foreign_attr.pyi | 6 +- .../aliases/foreign_class_member.pyi | 4 +- .../demo/_bindings/classes.pyi | 14 ++++- .../demo/_bindings/duplicate_enum.pyi | 18 ++++-- .../demo/_bindings/enum.pyi | 36 +++++++---- .../demo/_bindings/flawed_bindings.pyi | 36 +++++++++-- .../demo/_bindings/issues.pyi | 4 +- .../demo/_bindings/values.pyi | 15 +++-- .../demo/pure_python/functions.pyi | 10 ++- .../demo/pure_python/functions_3_8_plus.pyi | 2 +- .../demo/_bindings/aliases/foreign_attr.pyi | 6 +- .../aliases/foreign_class_member.pyi | 4 +- .../demo/_bindings/classes.pyi | 14 ++++- .../demo/_bindings/duplicate_enum.pyi | 18 ++++-- .../demo/_bindings/enum.pyi | 36 +++++++---- .../demo/_bindings/flawed_bindings.pyi | 33 ++++++++-- .../demo/_bindings/issues.pyi | 4 +- .../demo/_bindings/values.pyi | 15 +++-- .../demo/pure_python/functions.pyi | 10 ++- .../demo/_bindings/aliases/foreign_attr.pyi | 6 +- .../aliases/foreign_class_member.pyi | 4 +- .../demo/_bindings/classes.pyi | 14 ++++- .../demo/_bindings/duplicate_enum.pyi | 18 ++++-- .../demo/_bindings/enum.pyi | 36 +++++++---- .../demo/_bindings/flawed_bindings.pyi | 33 ++++++++-- .../demo/_bindings/issues.pyi | 4 +- .../demo/_bindings/values.pyi | 15 +++-- .../demo/pure_python/functions.pyi | 10 ++- .../demo/pure_python/functions_3_8_plus.pyi | 4 +- 60 files changed, 713 insertions(+), 214 deletions(-) diff --git a/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/aliases/foreign_attr.pyi b/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/aliases/foreign_attr.pyi index efb53a7..bd39444 100644 --- a/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/aliases/foreign_attr.pyi +++ b/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/aliases/foreign_attr.pyi @@ -1,6 +1,10 @@ from __future__ import annotations +import pybind11_stubgen.typing_ext + import demo._bindings.classes __all__ = ["value"] -value: demo._bindings.classes.Foo # value = +value: demo._bindings.classes.Foo = pybind11_stubgen.typing_ext.ValueExpr( + "" +) diff --git a/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/aliases/foreign_class_member.pyi b/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/aliases/foreign_class_member.pyi index 24968c9..1148e68 100644 --- a/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/aliases/foreign_class_member.pyi +++ b/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/aliases/foreign_class_member.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + import demo._bindings.classes __all__ = ["Bar1"] @@ -9,4 +11,4 @@ __all__ = ["Bar1"] class Bar1: foo: typing.ClassVar[ demo._bindings.classes.Foo - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") diff --git a/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/classes.pyi b/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/classes.pyi index 4a3b7bd..8e23a2a 100644 --- a/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/classes.pyi +++ b/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/classes.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = ["Base", "CppException", "Derived", "Foo", "Outer"] class Base: @@ -34,11 +36,17 @@ class Outer: TWO """ - ONE: typing.ClassVar[Outer.Inner.NestedEnum] # value = - TWO: typing.ClassVar[Outer.Inner.NestedEnum] # value = + ONE: typing.ClassVar[ + Outer.Inner.NestedEnum + ] = pybind11_stubgen.typing_ext.ValueExpr("") + TWO: typing.ClassVar[ + Outer.Inner.NestedEnum + ] = pybind11_stubgen.typing_ext.ValueExpr("") __members__: typing.ClassVar[ dict[str, Outer.Inner.NestedEnum] - ] # value = {'ONE': , 'TWO': } + ] = pybind11_stubgen.typing_ext.ValueExpr( + "{'ONE': , 'TWO': }" + ) def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... diff --git a/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/duplicate_enum.pyi b/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/duplicate_enum.pyi index 70eae65..35badaa 100644 --- a/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/duplicate_enum.pyi +++ b/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/duplicate_enum.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = ["ConsoleForegroundColor", "Magenta", "accepts_ambiguous_enum"] class ConsoleForegroundColor: @@ -13,10 +15,12 @@ class ConsoleForegroundColor: Magenta: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") __members__: typing.ClassVar[ dict[str, ConsoleForegroundColor] - ] # value = {'Magenta': } + ] = pybind11_stubgen.typing_ext.ValueExpr( + "{'Magenta': }" + ) def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... @@ -32,6 +36,12 @@ class ConsoleForegroundColor: @property def value(self) -> int: ... -def accepts_ambiguous_enum(color: ConsoleForegroundColor = ...) -> None: ... +def accepts_ambiguous_enum( + color: ConsoleForegroundColor = pybind11_stubgen.typing_ext.InvalidExpr( + "" + ), +) -> None: ... -Magenta: ConsoleForegroundColor # value = +Magenta: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) diff --git a/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/eigen.pyi b/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/eigen.pyi index 92c4b1c..9f6fa55 100644 --- a/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/eigen.pyi +++ b/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/eigen.pyi @@ -3,6 +3,7 @@ from __future__ import annotations import typing import numpy +import pybind11_stubgen.typing_ext import scipy.sparse __all__ = [ @@ -25,12 +26,20 @@ N = typing.TypeVar("N", bound=int) def accept_matrix_int( arg0: numpy.ndarray[ - tuple[typing.Literal[3], typing.Literal[3]], numpy.dtype[numpy.int32] + tuple[ + typing.Literal[pybind11_stubgen.typing_ext.ValueExpr("3")], + typing.Literal[pybind11_stubgen.typing_ext.ValueExpr("3")], + ], + numpy.dtype[numpy.int32], ] ) -> None: ... def accept_vector_float64( arg0: numpy.ndarray[ - tuple[typing.Literal[3], typing.Literal[1]], numpy.dtype[numpy.float64] + tuple[ + typing.Literal[pybind11_stubgen.typing_ext.ValueExpr("3")], + typing.Literal[pybind11_stubgen.typing_ext.ValueExpr("1")], + ], + numpy.dtype[numpy.float64], ] ) -> None: ... def dense_matrix_c( @@ -41,30 +50,62 @@ def dense_matrix_r( ) -> numpy.ndarray[tuple[M, N], numpy.dtype[numpy.float32]]: ... def fixed_mutator_a( arg0: numpy.ndarray[ - tuple[typing.Literal[5], typing.Literal[6]], numpy.dtype[numpy.float32] + tuple[ + typing.Literal[pybind11_stubgen.typing_ext.ValueExpr("5")], + typing.Literal[pybind11_stubgen.typing_ext.ValueExpr("6")], + ], + numpy.dtype[numpy.float32], ] ) -> None: ... def fixed_mutator_c( arg0: numpy.ndarray[ - tuple[typing.Literal[5], typing.Literal[6]], numpy.dtype[numpy.float32] + tuple[ + typing.Literal[pybind11_stubgen.typing_ext.ValueExpr("5")], + typing.Literal[pybind11_stubgen.typing_ext.ValueExpr("6")], + ], + numpy.dtype[numpy.float32], ] ) -> None: ... def fixed_mutator_r( arg0: numpy.ndarray[ - tuple[typing.Literal[5], typing.Literal[6]], numpy.dtype[numpy.float32] + tuple[ + typing.Literal[pybind11_stubgen.typing_ext.ValueExpr("5")], + typing.Literal[pybind11_stubgen.typing_ext.ValueExpr("6")], + ], + numpy.dtype[numpy.float32], ] ) -> None: ... def four_col_matrix_r( - arg0: numpy.ndarray[tuple[M, typing.Literal[4]], numpy.dtype[numpy.float32]] -) -> numpy.ndarray[tuple[M, typing.Literal[4]], numpy.dtype[numpy.float32]]: ... + arg0: numpy.ndarray[ + tuple[M, typing.Literal[pybind11_stubgen.typing_ext.ValueExpr("4")]], + numpy.dtype[numpy.float32], + ] +) -> numpy.ndarray[ + tuple[M, typing.Literal[pybind11_stubgen.typing_ext.ValueExpr("4")]], + numpy.dtype[numpy.float32], +]: ... def four_row_matrix_r( - arg0: numpy.ndarray[tuple[typing.Literal[4], N], numpy.dtype[numpy.float32]] -) -> numpy.ndarray[tuple[typing.Literal[4], N], numpy.dtype[numpy.float32]]: ... + arg0: numpy.ndarray[ + tuple[typing.Literal[pybind11_stubgen.typing_ext.ValueExpr("4")], N], + numpy.dtype[numpy.float32], + ] +) -> numpy.ndarray[ + tuple[typing.Literal[pybind11_stubgen.typing_ext.ValueExpr("4")], N], + numpy.dtype[numpy.float32], +]: ... def get_matrix_int() -> numpy.ndarray[ - tuple[typing.Literal[3], typing.Literal[3]], numpy.dtype[numpy.int32] + tuple[ + typing.Literal[pybind11_stubgen.typing_ext.ValueExpr("3")], + typing.Literal[pybind11_stubgen.typing_ext.ValueExpr("3")], + ], + numpy.dtype[numpy.int32], ]: ... def get_vector_float64() -> numpy.ndarray[ - tuple[typing.Literal[3], typing.Literal[1]], numpy.dtype[numpy.float64] + tuple[ + typing.Literal[pybind11_stubgen.typing_ext.ValueExpr("3")], + typing.Literal[pybind11_stubgen.typing_ext.ValueExpr("1")], + ], + numpy.dtype[numpy.float64], ]: ... def sparse_matrix_c(arg0: scipy.sparse.csc_matrix) -> scipy.sparse.csc_matrix: ... def sparse_matrix_r(arg0: scipy.sparse.csr_matrix) -> scipy.sparse.csr_matrix: ... diff --git a/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/enum.pyi b/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/enum.pyi index e3f9e10..33c8e6b 100644 --- a/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/enum.pyi +++ b/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/enum.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = [ "Blue", "ConsoleForegroundColor", @@ -29,22 +31,24 @@ class ConsoleForegroundColor: Blue: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") Green: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") Magenta: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") None_: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") Yellow: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") __members__: typing.ClassVar[ dict[str, ConsoleForegroundColor] - ] # value = {'Green': , 'Yellow': , 'Blue': , 'Magenta': , 'None_': } + ] = pybind11_stubgen.typing_ext.ValueExpr( + "{'Green': , 'Yellow': , 'Blue': , 'Magenta': , 'None_': }" + ) def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... @@ -64,8 +68,18 @@ def accept_defaulted_enum( color: ConsoleForegroundColor = ConsoleForegroundColor.None_, ) -> None: ... -Blue: ConsoleForegroundColor # value = -Green: ConsoleForegroundColor # value = -Magenta: ConsoleForegroundColor # value = -None_: ConsoleForegroundColor # value = -Yellow: ConsoleForegroundColor # value = +Blue: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) +Green: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) +Magenta: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) +None_: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) +Yellow: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) diff --git a/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/flawed_bindings.pyi b/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/flawed_bindings.pyi index 04f104f..752f2ea 100644 --- a/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/flawed_bindings.pyi +++ b/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/flawed_bindings.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = [ "Enum", "Unbound", @@ -18,8 +20,32 @@ class Enum: class Unbound: pass -def accept_unbound_enum(arg0: typing.Annotated[typing.Any, ...]) -> int: ... -def accept_unbound_enum_defaulted(x: Enum = ...) -> int: ... -def accept_unbound_type(arg0: tuple[typing.Annotated[typing.Any, ...], int]) -> int: ... -def accept_unbound_type_defaulted(x: Unbound = ...) -> int: ... -def get_unbound_type() -> typing.Annotated[typing.Any, ...]: ... +def accept_unbound_enum( + arg0: typing.Annotated[ + typing.Any, + pybind11_stubgen.typing_ext.InvalidExpr("(anonymous namespace)::Enum"), + ] +) -> int: ... +def accept_unbound_enum_defaulted( + x: Enum = pybind11_stubgen.typing_ext.InvalidExpr( + "" + ), +) -> int: ... +def accept_unbound_type( + arg0: tuple[ + typing.Annotated[ + typing.Any, + pybind11_stubgen.typing_ext.InvalidExpr("(anonymous namespace)::Unbound"), + ], + int, + ] +) -> int: ... +def accept_unbound_type_defaulted( + x: Unbound = pybind11_stubgen.typing_ext.InvalidExpr( + "" + ), +) -> int: ... +def get_unbound_type() -> typing.Annotated[ + typing.Any, + pybind11_stubgen.typing_ext.InvalidExpr("(anonymous namespace)::Unbound"), +]: ... diff --git a/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/issues.pyi b/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/issues.pyi index 09af4e4..029d664 100644 --- a/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/issues.pyi +++ b/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/issues.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = ["issue_51_catastrophic_regex", "issue_73_utf8_doc_chars"] def issue_51_catastrophic_regex(arg0: int, arg1: int) -> None: @@ -21,4 +23,4 @@ def issue_73_utf8_doc_chars() -> None: values provide more damping in response. """ -_cleanup: typing.Any # value = +_cleanup: typing.Any = pybind11_stubgen.typing_ext.ValueExpr("") diff --git a/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/values.pyi b/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/values.pyi index eb4a85a..b049f81 100644 --- a/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/values.pyi +++ b/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/_bindings/values.pyi @@ -3,6 +3,7 @@ from __future__ import annotations import datetime import numpy +import pybind11_stubgen.typing_ext from numpy import random __all__ = [ @@ -27,10 +28,14 @@ class Foo: def add_day(arg0: datetime.datetime) -> datetime.datetime: ... -foolist: list # value = [, ] -foovar: Foo # value = +foolist: list = pybind11_stubgen.typing_ext.ValueExpr( + "[, ]" +) +foovar: Foo = pybind11_stubgen.typing_ext.ValueExpr( + "" +) list_with_none: list = [None, 2, {}] none = None -t_10ms: datetime.timedelta # value = datetime.timedelta(microseconds=10000) -t_20ns: datetime.timedelta # value = datetime.timedelta(0) -t_30s: datetime.timedelta # value = datetime.timedelta(seconds=30) +t_10ms: datetime.timedelta = datetime.timedelta(microseconds=10000) +t_20ns: datetime.timedelta = datetime.timedelta(0) +t_30s: datetime.timedelta = datetime.timedelta(seconds=30) diff --git a/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/pure_python/functions.pyi b/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/pure_python/functions.pyi index a6c7165..320ddc7 100644 --- a/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/pure_python/functions.pyi +++ b/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/pure_python/functions.pyi @@ -3,6 +3,8 @@ from __future__ import annotations import sys as sys import typing as typing +import pybind11_stubgen.typing_ext + from demo.pure_python.functions_3_8_plus import args_mix from demo.pure_python.functions_3_9_plus import generic_alias_annotation @@ -24,8 +26,12 @@ class _Dummy: def foo(): ... def accept_frozenset(arg: frozenset[int | float]) -> int | None: ... -def builtin_function_as_default_arg(func: type(len) = len): ... -def function_as_default_arg(func: type(search) = search): ... +def builtin_function_as_default_arg( + func: pybind11_stubgen.typing_ext.ValueExpr("type(len)") = len, +): ... +def function_as_default_arg( + func: pybind11_stubgen.typing_ext.ValueExpr("type(search)") = search, +): ... def lambda_as_default_arg(callback=...): ... def search(a: int, b: list[int]) -> int: ... def static_method_as_default_arg(callback=_Dummy.foo): ... diff --git a/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/pure_python/functions_3_8_plus.pyi b/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/pure_python/functions_3_8_plus.pyi index dd9ffdc..3361a12 100644 --- a/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/pure_python/functions_3_8_plus.pyi +++ b/tests/stubs/python-3.12/pybind11-master/numpy-array-use-type-var/demo/pure_python/functions_3_8_plus.pyi @@ -11,5 +11,5 @@ def args_mix( *args: int, x: int = 1, y=int, - **kwargs: typing.Dict[int, str], + **kwargs: dict[int, str], ): ... diff --git a/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi b/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi index efb53a7..bd39444 100644 --- a/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi +++ b/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi @@ -1,6 +1,10 @@ from __future__ import annotations +import pybind11_stubgen.typing_ext + import demo._bindings.classes __all__ = ["value"] -value: demo._bindings.classes.Foo # value = +value: demo._bindings.classes.Foo = pybind11_stubgen.typing_ext.ValueExpr( + "" +) diff --git a/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi b/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi index 24968c9..1148e68 100644 --- a/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi +++ b/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + import demo._bindings.classes __all__ = ["Bar1"] @@ -9,4 +11,4 @@ __all__ = ["Bar1"] class Bar1: foo: typing.ClassVar[ demo._bindings.classes.Foo - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") diff --git a/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi b/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi index 4a3b7bd..8e23a2a 100644 --- a/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi +++ b/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = ["Base", "CppException", "Derived", "Foo", "Outer"] class Base: @@ -34,11 +36,17 @@ class Outer: TWO """ - ONE: typing.ClassVar[Outer.Inner.NestedEnum] # value = - TWO: typing.ClassVar[Outer.Inner.NestedEnum] # value = + ONE: typing.ClassVar[ + Outer.Inner.NestedEnum + ] = pybind11_stubgen.typing_ext.ValueExpr("") + TWO: typing.ClassVar[ + Outer.Inner.NestedEnum + ] = pybind11_stubgen.typing_ext.ValueExpr("") __members__: typing.ClassVar[ dict[str, Outer.Inner.NestedEnum] - ] # value = {'ONE': , 'TWO': } + ] = pybind11_stubgen.typing_ext.ValueExpr( + "{'ONE': , 'TWO': }" + ) def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... diff --git a/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/duplicate_enum.pyi b/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/duplicate_enum.pyi index 70eae65..35badaa 100644 --- a/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/duplicate_enum.pyi +++ b/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/duplicate_enum.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = ["ConsoleForegroundColor", "Magenta", "accepts_ambiguous_enum"] class ConsoleForegroundColor: @@ -13,10 +15,12 @@ class ConsoleForegroundColor: Magenta: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") __members__: typing.ClassVar[ dict[str, ConsoleForegroundColor] - ] # value = {'Magenta': } + ] = pybind11_stubgen.typing_ext.ValueExpr( + "{'Magenta': }" + ) def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... @@ -32,6 +36,12 @@ class ConsoleForegroundColor: @property def value(self) -> int: ... -def accepts_ambiguous_enum(color: ConsoleForegroundColor = ...) -> None: ... +def accepts_ambiguous_enum( + color: ConsoleForegroundColor = pybind11_stubgen.typing_ext.InvalidExpr( + "" + ), +) -> None: ... -Magenta: ConsoleForegroundColor # value = +Magenta: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) diff --git a/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi b/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi index e3f9e10..33c8e6b 100644 --- a/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi +++ b/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = [ "Blue", "ConsoleForegroundColor", @@ -29,22 +31,24 @@ class ConsoleForegroundColor: Blue: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") Green: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") Magenta: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") None_: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") Yellow: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") __members__: typing.ClassVar[ dict[str, ConsoleForegroundColor] - ] # value = {'Green': , 'Yellow': , 'Blue': , 'Magenta': , 'None_': } + ] = pybind11_stubgen.typing_ext.ValueExpr( + "{'Green': , 'Yellow': , 'Blue': , 'Magenta': , 'None_': }" + ) def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... @@ -64,8 +68,18 @@ def accept_defaulted_enum( color: ConsoleForegroundColor = ConsoleForegroundColor.None_, ) -> None: ... -Blue: ConsoleForegroundColor # value = -Green: ConsoleForegroundColor # value = -Magenta: ConsoleForegroundColor # value = -None_: ConsoleForegroundColor # value = -Yellow: ConsoleForegroundColor # value = +Blue: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) +Green: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) +Magenta: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) +None_: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) +Yellow: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) diff --git a/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi b/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi index 04f104f..752f2ea 100644 --- a/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi +++ b/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = [ "Enum", "Unbound", @@ -18,8 +20,32 @@ class Enum: class Unbound: pass -def accept_unbound_enum(arg0: typing.Annotated[typing.Any, ...]) -> int: ... -def accept_unbound_enum_defaulted(x: Enum = ...) -> int: ... -def accept_unbound_type(arg0: tuple[typing.Annotated[typing.Any, ...], int]) -> int: ... -def accept_unbound_type_defaulted(x: Unbound = ...) -> int: ... -def get_unbound_type() -> typing.Annotated[typing.Any, ...]: ... +def accept_unbound_enum( + arg0: typing.Annotated[ + typing.Any, + pybind11_stubgen.typing_ext.InvalidExpr("(anonymous namespace)::Enum"), + ] +) -> int: ... +def accept_unbound_enum_defaulted( + x: Enum = pybind11_stubgen.typing_ext.InvalidExpr( + "" + ), +) -> int: ... +def accept_unbound_type( + arg0: tuple[ + typing.Annotated[ + typing.Any, + pybind11_stubgen.typing_ext.InvalidExpr("(anonymous namespace)::Unbound"), + ], + int, + ] +) -> int: ... +def accept_unbound_type_defaulted( + x: Unbound = pybind11_stubgen.typing_ext.InvalidExpr( + "" + ), +) -> int: ... +def get_unbound_type() -> typing.Annotated[ + typing.Any, + pybind11_stubgen.typing_ext.InvalidExpr("(anonymous namespace)::Unbound"), +]: ... diff --git a/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi b/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi index 09af4e4..029d664 100644 --- a/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi +++ b/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = ["issue_51_catastrophic_regex", "issue_73_utf8_doc_chars"] def issue_51_catastrophic_regex(arg0: int, arg1: int) -> None: @@ -21,4 +23,4 @@ def issue_73_utf8_doc_chars() -> None: values provide more damping in response. """ -_cleanup: typing.Any # value = +_cleanup: typing.Any = pybind11_stubgen.typing_ext.ValueExpr("") diff --git a/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi b/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi index eb4a85a..b049f81 100644 --- a/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi +++ b/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi @@ -3,6 +3,7 @@ from __future__ import annotations import datetime import numpy +import pybind11_stubgen.typing_ext from numpy import random __all__ = [ @@ -27,10 +28,14 @@ class Foo: def add_day(arg0: datetime.datetime) -> datetime.datetime: ... -foolist: list # value = [, ] -foovar: Foo # value = +foolist: list = pybind11_stubgen.typing_ext.ValueExpr( + "[, ]" +) +foovar: Foo = pybind11_stubgen.typing_ext.ValueExpr( + "" +) list_with_none: list = [None, 2, {}] none = None -t_10ms: datetime.timedelta # value = datetime.timedelta(microseconds=10000) -t_20ns: datetime.timedelta # value = datetime.timedelta(0) -t_30s: datetime.timedelta # value = datetime.timedelta(seconds=30) +t_10ms: datetime.timedelta = datetime.timedelta(microseconds=10000) +t_20ns: datetime.timedelta = datetime.timedelta(0) +t_30s: datetime.timedelta = datetime.timedelta(seconds=30) diff --git a/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi b/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi index a6c7165..320ddc7 100644 --- a/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi +++ b/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi @@ -3,6 +3,8 @@ from __future__ import annotations import sys as sys import typing as typing +import pybind11_stubgen.typing_ext + from demo.pure_python.functions_3_8_plus import args_mix from demo.pure_python.functions_3_9_plus import generic_alias_annotation @@ -24,8 +26,12 @@ class _Dummy: def foo(): ... def accept_frozenset(arg: frozenset[int | float]) -> int | None: ... -def builtin_function_as_default_arg(func: type(len) = len): ... -def function_as_default_arg(func: type(search) = search): ... +def builtin_function_as_default_arg( + func: pybind11_stubgen.typing_ext.ValueExpr("type(len)") = len, +): ... +def function_as_default_arg( + func: pybind11_stubgen.typing_ext.ValueExpr("type(search)") = search, +): ... def lambda_as_default_arg(callback=...): ... def search(a: int, b: list[int]) -> int: ... def static_method_as_default_arg(callback=_Dummy.foo): ... diff --git a/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi b/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi index dd9ffdc..3361a12 100644 --- a/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi +++ b/tests/stubs/python-3.12/pybind11-master/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi @@ -11,5 +11,5 @@ def args_mix( *args: int, x: int = 1, y=int, - **kwargs: typing.Dict[int, str], + **kwargs: dict[int, str], ): ... diff --git a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi index efb53a7..bd39444 100644 --- a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi @@ -1,6 +1,10 @@ from __future__ import annotations +import pybind11_stubgen.typing_ext + import demo._bindings.classes __all__ = ["value"] -value: demo._bindings.classes.Foo # value = +value: demo._bindings.classes.Foo = pybind11_stubgen.typing_ext.ValueExpr( + "" +) diff --git a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi index 24968c9..1148e68 100644 --- a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + import demo._bindings.classes __all__ = ["Bar1"] @@ -9,4 +11,4 @@ __all__ = ["Bar1"] class Bar1: foo: typing.ClassVar[ demo._bindings.classes.Foo - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") diff --git a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi index 4a3b7bd..8e23a2a 100644 --- a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = ["Base", "CppException", "Derived", "Foo", "Outer"] class Base: @@ -34,11 +36,17 @@ class Outer: TWO """ - ONE: typing.ClassVar[Outer.Inner.NestedEnum] # value = - TWO: typing.ClassVar[Outer.Inner.NestedEnum] # value = + ONE: typing.ClassVar[ + Outer.Inner.NestedEnum + ] = pybind11_stubgen.typing_ext.ValueExpr("") + TWO: typing.ClassVar[ + Outer.Inner.NestedEnum + ] = pybind11_stubgen.typing_ext.ValueExpr("") __members__: typing.ClassVar[ dict[str, Outer.Inner.NestedEnum] - ] # value = {'ONE': , 'TWO': } + ] = pybind11_stubgen.typing_ext.ValueExpr( + "{'ONE': , 'TWO': }" + ) def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... diff --git a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/duplicate_enum.pyi b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/duplicate_enum.pyi index 70eae65..35badaa 100644 --- a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/duplicate_enum.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/duplicate_enum.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = ["ConsoleForegroundColor", "Magenta", "accepts_ambiguous_enum"] class ConsoleForegroundColor: @@ -13,10 +15,12 @@ class ConsoleForegroundColor: Magenta: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") __members__: typing.ClassVar[ dict[str, ConsoleForegroundColor] - ] # value = {'Magenta': } + ] = pybind11_stubgen.typing_ext.ValueExpr( + "{'Magenta': }" + ) def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... @@ -32,6 +36,12 @@ class ConsoleForegroundColor: @property def value(self) -> int: ... -def accepts_ambiguous_enum(color: ConsoleForegroundColor = ...) -> None: ... +def accepts_ambiguous_enum( + color: ConsoleForegroundColor = pybind11_stubgen.typing_ext.InvalidExpr( + "" + ), +) -> None: ... -Magenta: ConsoleForegroundColor # value = +Magenta: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) diff --git a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi index e3f9e10..33c8e6b 100644 --- a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = [ "Blue", "ConsoleForegroundColor", @@ -29,22 +31,24 @@ class ConsoleForegroundColor: Blue: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") Green: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") Magenta: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") None_: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") Yellow: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") __members__: typing.ClassVar[ dict[str, ConsoleForegroundColor] - ] # value = {'Green': , 'Yellow': , 'Blue': , 'Magenta': , 'None_': } + ] = pybind11_stubgen.typing_ext.ValueExpr( + "{'Green': , 'Yellow': , 'Blue': , 'Magenta': , 'None_': }" + ) def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... @@ -64,8 +68,18 @@ def accept_defaulted_enum( color: ConsoleForegroundColor = ConsoleForegroundColor.None_, ) -> None: ... -Blue: ConsoleForegroundColor # value = -Green: ConsoleForegroundColor # value = -Magenta: ConsoleForegroundColor # value = -None_: ConsoleForegroundColor # value = -Yellow: ConsoleForegroundColor # value = +Blue: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) +Green: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) +Magenta: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) +None_: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) +Yellow: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) diff --git a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi index 04f104f..752f2ea 100644 --- a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = [ "Enum", "Unbound", @@ -18,8 +20,32 @@ class Enum: class Unbound: pass -def accept_unbound_enum(arg0: typing.Annotated[typing.Any, ...]) -> int: ... -def accept_unbound_enum_defaulted(x: Enum = ...) -> int: ... -def accept_unbound_type(arg0: tuple[typing.Annotated[typing.Any, ...], int]) -> int: ... -def accept_unbound_type_defaulted(x: Unbound = ...) -> int: ... -def get_unbound_type() -> typing.Annotated[typing.Any, ...]: ... +def accept_unbound_enum( + arg0: typing.Annotated[ + typing.Any, + pybind11_stubgen.typing_ext.InvalidExpr("(anonymous namespace)::Enum"), + ] +) -> int: ... +def accept_unbound_enum_defaulted( + x: Enum = pybind11_stubgen.typing_ext.InvalidExpr( + "" + ), +) -> int: ... +def accept_unbound_type( + arg0: tuple[ + typing.Annotated[ + typing.Any, + pybind11_stubgen.typing_ext.InvalidExpr("(anonymous namespace)::Unbound"), + ], + int, + ] +) -> int: ... +def accept_unbound_type_defaulted( + x: Unbound = pybind11_stubgen.typing_ext.InvalidExpr( + "" + ), +) -> int: ... +def get_unbound_type() -> typing.Annotated[ + typing.Any, + pybind11_stubgen.typing_ext.InvalidExpr("(anonymous namespace)::Unbound"), +]: ... diff --git a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi index 09af4e4..029d664 100644 --- a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = ["issue_51_catastrophic_regex", "issue_73_utf8_doc_chars"] def issue_51_catastrophic_regex(arg0: int, arg1: int) -> None: @@ -21,4 +23,4 @@ def issue_73_utf8_doc_chars() -> None: values provide more damping in response. """ -_cleanup: typing.Any # value = +_cleanup: typing.Any = pybind11_stubgen.typing_ext.ValueExpr("") diff --git a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi index eb4a85a..b049f81 100644 --- a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi @@ -3,6 +3,7 @@ from __future__ import annotations import datetime import numpy +import pybind11_stubgen.typing_ext from numpy import random __all__ = [ @@ -27,10 +28,14 @@ class Foo: def add_day(arg0: datetime.datetime) -> datetime.datetime: ... -foolist: list # value = [, ] -foovar: Foo # value = +foolist: list = pybind11_stubgen.typing_ext.ValueExpr( + "[, ]" +) +foovar: Foo = pybind11_stubgen.typing_ext.ValueExpr( + "" +) list_with_none: list = [None, 2, {}] none = None -t_10ms: datetime.timedelta # value = datetime.timedelta(microseconds=10000) -t_20ns: datetime.timedelta # value = datetime.timedelta(0) -t_30s: datetime.timedelta # value = datetime.timedelta(seconds=30) +t_10ms: datetime.timedelta = datetime.timedelta(microseconds=10000) +t_20ns: datetime.timedelta = datetime.timedelta(0) +t_30s: datetime.timedelta = datetime.timedelta(seconds=30) diff --git a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi index a6c7165..320ddc7 100644 --- a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi @@ -3,6 +3,8 @@ from __future__ import annotations import sys as sys import typing as typing +import pybind11_stubgen.typing_ext + from demo.pure_python.functions_3_8_plus import args_mix from demo.pure_python.functions_3_9_plus import generic_alias_annotation @@ -24,8 +26,12 @@ class _Dummy: def foo(): ... def accept_frozenset(arg: frozenset[int | float]) -> int | None: ... -def builtin_function_as_default_arg(func: type(len) = len): ... -def function_as_default_arg(func: type(search) = search): ... +def builtin_function_as_default_arg( + func: pybind11_stubgen.typing_ext.ValueExpr("type(len)") = len, +): ... +def function_as_default_arg( + func: pybind11_stubgen.typing_ext.ValueExpr("type(search)") = search, +): ... def lambda_as_default_arg(callback=...): ... def search(a: int, b: list[int]) -> int: ... def static_method_as_default_arg(callback=_Dummy.foo): ... diff --git a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi index dd9ffdc..3361a12 100644 --- a/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.11/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi @@ -11,5 +11,5 @@ def args_mix( *args: int, x: int = 1, y=int, - **kwargs: typing.Dict[int, str], + **kwargs: dict[int, str], ): ... diff --git a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi index efb53a7..bd39444 100644 --- a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi @@ -1,6 +1,10 @@ from __future__ import annotations +import pybind11_stubgen.typing_ext + import demo._bindings.classes __all__ = ["value"] -value: demo._bindings.classes.Foo # value = +value: demo._bindings.classes.Foo = pybind11_stubgen.typing_ext.ValueExpr( + "" +) diff --git a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi index 24968c9..1148e68 100644 --- a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + import demo._bindings.classes __all__ = ["Bar1"] @@ -9,4 +11,4 @@ __all__ = ["Bar1"] class Bar1: foo: typing.ClassVar[ demo._bindings.classes.Foo - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") diff --git a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi index 4a3b7bd..8e23a2a 100644 --- a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = ["Base", "CppException", "Derived", "Foo", "Outer"] class Base: @@ -34,11 +36,17 @@ class Outer: TWO """ - ONE: typing.ClassVar[Outer.Inner.NestedEnum] # value = - TWO: typing.ClassVar[Outer.Inner.NestedEnum] # value = + ONE: typing.ClassVar[ + Outer.Inner.NestedEnum + ] = pybind11_stubgen.typing_ext.ValueExpr("") + TWO: typing.ClassVar[ + Outer.Inner.NestedEnum + ] = pybind11_stubgen.typing_ext.ValueExpr("") __members__: typing.ClassVar[ dict[str, Outer.Inner.NestedEnum] - ] # value = {'ONE': , 'TWO': } + ] = pybind11_stubgen.typing_ext.ValueExpr( + "{'ONE': , 'TWO': }" + ) def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... diff --git a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/duplicate_enum.pyi b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/duplicate_enum.pyi index 70eae65..35badaa 100644 --- a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/duplicate_enum.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/duplicate_enum.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = ["ConsoleForegroundColor", "Magenta", "accepts_ambiguous_enum"] class ConsoleForegroundColor: @@ -13,10 +15,12 @@ class ConsoleForegroundColor: Magenta: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") __members__: typing.ClassVar[ dict[str, ConsoleForegroundColor] - ] # value = {'Magenta': } + ] = pybind11_stubgen.typing_ext.ValueExpr( + "{'Magenta': }" + ) def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... @@ -32,6 +36,12 @@ class ConsoleForegroundColor: @property def value(self) -> int: ... -def accepts_ambiguous_enum(color: ConsoleForegroundColor = ...) -> None: ... +def accepts_ambiguous_enum( + color: ConsoleForegroundColor = pybind11_stubgen.typing_ext.InvalidExpr( + "" + ), +) -> None: ... -Magenta: ConsoleForegroundColor # value = +Magenta: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) diff --git a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi index e3f9e10..33c8e6b 100644 --- a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = [ "Blue", "ConsoleForegroundColor", @@ -29,22 +31,24 @@ class ConsoleForegroundColor: Blue: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") Green: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") Magenta: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") None_: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") Yellow: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") __members__: typing.ClassVar[ dict[str, ConsoleForegroundColor] - ] # value = {'Green': , 'Yellow': , 'Blue': , 'Magenta': , 'None_': } + ] = pybind11_stubgen.typing_ext.ValueExpr( + "{'Green': , 'Yellow': , 'Blue': , 'Magenta': , 'None_': }" + ) def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... @@ -64,8 +68,18 @@ def accept_defaulted_enum( color: ConsoleForegroundColor = ConsoleForegroundColor.None_, ) -> None: ... -Blue: ConsoleForegroundColor # value = -Green: ConsoleForegroundColor # value = -Magenta: ConsoleForegroundColor # value = -None_: ConsoleForegroundColor # value = -Yellow: ConsoleForegroundColor # value = +Blue: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) +Green: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) +Magenta: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) +None_: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) +Yellow: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) diff --git a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi index 04f104f..752f2ea 100644 --- a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = [ "Enum", "Unbound", @@ -18,8 +20,32 @@ class Enum: class Unbound: pass -def accept_unbound_enum(arg0: typing.Annotated[typing.Any, ...]) -> int: ... -def accept_unbound_enum_defaulted(x: Enum = ...) -> int: ... -def accept_unbound_type(arg0: tuple[typing.Annotated[typing.Any, ...], int]) -> int: ... -def accept_unbound_type_defaulted(x: Unbound = ...) -> int: ... -def get_unbound_type() -> typing.Annotated[typing.Any, ...]: ... +def accept_unbound_enum( + arg0: typing.Annotated[ + typing.Any, + pybind11_stubgen.typing_ext.InvalidExpr("(anonymous namespace)::Enum"), + ] +) -> int: ... +def accept_unbound_enum_defaulted( + x: Enum = pybind11_stubgen.typing_ext.InvalidExpr( + "" + ), +) -> int: ... +def accept_unbound_type( + arg0: tuple[ + typing.Annotated[ + typing.Any, + pybind11_stubgen.typing_ext.InvalidExpr("(anonymous namespace)::Unbound"), + ], + int, + ] +) -> int: ... +def accept_unbound_type_defaulted( + x: Unbound = pybind11_stubgen.typing_ext.InvalidExpr( + "" + ), +) -> int: ... +def get_unbound_type() -> typing.Annotated[ + typing.Any, + pybind11_stubgen.typing_ext.InvalidExpr("(anonymous namespace)::Unbound"), +]: ... diff --git a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi index 09af4e4..029d664 100644 --- a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = ["issue_51_catastrophic_regex", "issue_73_utf8_doc_chars"] def issue_51_catastrophic_regex(arg0: int, arg1: int) -> None: @@ -21,4 +23,4 @@ def issue_73_utf8_doc_chars() -> None: values provide more damping in response. """ -_cleanup: typing.Any # value = +_cleanup: typing.Any = pybind11_stubgen.typing_ext.ValueExpr("") diff --git a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi index eb4a85a..b049f81 100644 --- a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi @@ -3,6 +3,7 @@ from __future__ import annotations import datetime import numpy +import pybind11_stubgen.typing_ext from numpy import random __all__ = [ @@ -27,10 +28,14 @@ class Foo: def add_day(arg0: datetime.datetime) -> datetime.datetime: ... -foolist: list # value = [, ] -foovar: Foo # value = +foolist: list = pybind11_stubgen.typing_ext.ValueExpr( + "[, ]" +) +foovar: Foo = pybind11_stubgen.typing_ext.ValueExpr( + "" +) list_with_none: list = [None, 2, {}] none = None -t_10ms: datetime.timedelta # value = datetime.timedelta(microseconds=10000) -t_20ns: datetime.timedelta # value = datetime.timedelta(0) -t_30s: datetime.timedelta # value = datetime.timedelta(seconds=30) +t_10ms: datetime.timedelta = datetime.timedelta(microseconds=10000) +t_20ns: datetime.timedelta = datetime.timedelta(0) +t_30s: datetime.timedelta = datetime.timedelta(seconds=30) diff --git a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi index a6c7165..320ddc7 100644 --- a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi @@ -3,6 +3,8 @@ from __future__ import annotations import sys as sys import typing as typing +import pybind11_stubgen.typing_ext + from demo.pure_python.functions_3_8_plus import args_mix from demo.pure_python.functions_3_9_plus import generic_alias_annotation @@ -24,8 +26,12 @@ class _Dummy: def foo(): ... def accept_frozenset(arg: frozenset[int | float]) -> int | None: ... -def builtin_function_as_default_arg(func: type(len) = len): ... -def function_as_default_arg(func: type(search) = search): ... +def builtin_function_as_default_arg( + func: pybind11_stubgen.typing_ext.ValueExpr("type(len)") = len, +): ... +def function_as_default_arg( + func: pybind11_stubgen.typing_ext.ValueExpr("type(search)") = search, +): ... def lambda_as_default_arg(callback=...): ... def search(a: int, b: list[int]) -> int: ... def static_method_as_default_arg(callback=_Dummy.foo): ... diff --git a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi index dd9ffdc..3361a12 100644 --- a/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi +++ b/tests/stubs/python-3.12/pybind11-v2.9/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi @@ -11,5 +11,5 @@ def args_mix( *args: int, x: int = 1, y=int, - **kwargs: typing.Dict[int, str], + **kwargs: dict[int, str], ): ... diff --git a/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi b/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi index efb53a7..bd39444 100644 --- a/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi +++ b/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi @@ -1,6 +1,10 @@ from __future__ import annotations +import pybind11_stubgen.typing_ext + import demo._bindings.classes __all__ = ["value"] -value: demo._bindings.classes.Foo # value = +value: demo._bindings.classes.Foo = pybind11_stubgen.typing_ext.ValueExpr( + "" +) diff --git a/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi b/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi index 24968c9..1148e68 100644 --- a/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi +++ b/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + import demo._bindings.classes __all__ = ["Bar1"] @@ -9,4 +11,4 @@ __all__ = ["Bar1"] class Bar1: foo: typing.ClassVar[ demo._bindings.classes.Foo - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") diff --git a/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi b/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi index 4a3b7bd..8e23a2a 100644 --- a/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi +++ b/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = ["Base", "CppException", "Derived", "Foo", "Outer"] class Base: @@ -34,11 +36,17 @@ class Outer: TWO """ - ONE: typing.ClassVar[Outer.Inner.NestedEnum] # value = - TWO: typing.ClassVar[Outer.Inner.NestedEnum] # value = + ONE: typing.ClassVar[ + Outer.Inner.NestedEnum + ] = pybind11_stubgen.typing_ext.ValueExpr("") + TWO: typing.ClassVar[ + Outer.Inner.NestedEnum + ] = pybind11_stubgen.typing_ext.ValueExpr("") __members__: typing.ClassVar[ dict[str, Outer.Inner.NestedEnum] - ] # value = {'ONE': , 'TWO': } + ] = pybind11_stubgen.typing_ext.ValueExpr( + "{'ONE': , 'TWO': }" + ) def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... diff --git a/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/duplicate_enum.pyi b/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/duplicate_enum.pyi index 70eae65..35badaa 100644 --- a/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/duplicate_enum.pyi +++ b/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/duplicate_enum.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = ["ConsoleForegroundColor", "Magenta", "accepts_ambiguous_enum"] class ConsoleForegroundColor: @@ -13,10 +15,12 @@ class ConsoleForegroundColor: Magenta: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") __members__: typing.ClassVar[ dict[str, ConsoleForegroundColor] - ] # value = {'Magenta': } + ] = pybind11_stubgen.typing_ext.ValueExpr( + "{'Magenta': }" + ) def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... @@ -32,6 +36,12 @@ class ConsoleForegroundColor: @property def value(self) -> int: ... -def accepts_ambiguous_enum(color: ConsoleForegroundColor = ...) -> None: ... +def accepts_ambiguous_enum( + color: ConsoleForegroundColor = pybind11_stubgen.typing_ext.InvalidExpr( + "" + ), +) -> None: ... -Magenta: ConsoleForegroundColor # value = +Magenta: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) diff --git a/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi b/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi index e3f9e10..33c8e6b 100644 --- a/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi +++ b/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = [ "Blue", "ConsoleForegroundColor", @@ -29,22 +31,24 @@ class ConsoleForegroundColor: Blue: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") Green: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") Magenta: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") None_: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") Yellow: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") __members__: typing.ClassVar[ dict[str, ConsoleForegroundColor] - ] # value = {'Green': , 'Yellow': , 'Blue': , 'Magenta': , 'None_': } + ] = pybind11_stubgen.typing_ext.ValueExpr( + "{'Green': , 'Yellow': , 'Blue': , 'Magenta': , 'None_': }" + ) def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... @@ -64,8 +68,18 @@ def accept_defaulted_enum( color: ConsoleForegroundColor = ConsoleForegroundColor.None_, ) -> None: ... -Blue: ConsoleForegroundColor # value = -Green: ConsoleForegroundColor # value = -Magenta: ConsoleForegroundColor # value = -None_: ConsoleForegroundColor # value = -Yellow: ConsoleForegroundColor # value = +Blue: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) +Green: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) +Magenta: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) +None_: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) +Yellow: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) diff --git a/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi b/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi index f61b9ca..b0cc0b8 100644 --- a/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi +++ b/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi @@ -2,6 +2,7 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext import typing_extensions __all__ = [ @@ -20,10 +21,32 @@ class Enum: class Unbound: pass -def accept_unbound_enum(arg0: typing_extensions.Annotated[typing.Any, ...]) -> int: ... -def accept_unbound_enum_defaulted(x: Enum = ...) -> int: ... +def accept_unbound_enum( + arg0: typing_extensions.Annotated[ + typing.Any, + pybind11_stubgen.typing_ext.InvalidExpr("(anonymous namespace)::Enum"), + ] +) -> int: ... +def accept_unbound_enum_defaulted( + x: Enum = pybind11_stubgen.typing_ext.InvalidExpr( + "" + ), +) -> int: ... def accept_unbound_type( - arg0: tuple[typing_extensions.Annotated[typing.Any, ...], int] + arg0: tuple[ + typing_extensions.Annotated[ + typing.Any, + pybind11_stubgen.typing_ext.InvalidExpr("(anonymous namespace)::Unbound"), + ], + int, + ] +) -> int: ... +def accept_unbound_type_defaulted( + x: Unbound = pybind11_stubgen.typing_ext.InvalidExpr( + "" + ), ) -> int: ... -def accept_unbound_type_defaulted(x: Unbound = ...) -> int: ... -def get_unbound_type() -> typing_extensions.Annotated[typing.Any, ...]: ... +def get_unbound_type() -> typing_extensions.Annotated[ + typing.Any, + pybind11_stubgen.typing_ext.InvalidExpr("(anonymous namespace)::Unbound"), +]: ... diff --git a/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi b/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi index 09af4e4..029d664 100644 --- a/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi +++ b/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = ["issue_51_catastrophic_regex", "issue_73_utf8_doc_chars"] def issue_51_catastrophic_regex(arg0: int, arg1: int) -> None: @@ -21,4 +23,4 @@ def issue_73_utf8_doc_chars() -> None: values provide more damping in response. """ -_cleanup: typing.Any # value = +_cleanup: typing.Any = pybind11_stubgen.typing_ext.ValueExpr("") diff --git a/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi b/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi index eb4a85a..b049f81 100644 --- a/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi +++ b/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi @@ -3,6 +3,7 @@ from __future__ import annotations import datetime import numpy +import pybind11_stubgen.typing_ext from numpy import random __all__ = [ @@ -27,10 +28,14 @@ class Foo: def add_day(arg0: datetime.datetime) -> datetime.datetime: ... -foolist: list # value = [, ] -foovar: Foo # value = +foolist: list = pybind11_stubgen.typing_ext.ValueExpr( + "[, ]" +) +foovar: Foo = pybind11_stubgen.typing_ext.ValueExpr( + "" +) list_with_none: list = [None, 2, {}] none = None -t_10ms: datetime.timedelta # value = datetime.timedelta(microseconds=10000) -t_20ns: datetime.timedelta # value = datetime.timedelta(0) -t_30s: datetime.timedelta # value = datetime.timedelta(seconds=30) +t_10ms: datetime.timedelta = datetime.timedelta(microseconds=10000) +t_20ns: datetime.timedelta = datetime.timedelta(0) +t_30s: datetime.timedelta = datetime.timedelta(seconds=30) diff --git a/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi b/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi index ec036d0..b230b1d 100644 --- a/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi +++ b/tests/stubs/python-3.7/pybind11-master/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi @@ -3,6 +3,8 @@ from __future__ import annotations import sys as sys import typing as typing +import pybind11_stubgen.typing_ext + __all__ = [ "accept_frozenset", "builtin_function_as_default_arg", @@ -19,8 +21,12 @@ class _Dummy: def foo(): ... def accept_frozenset(arg: frozenset[int | float]) -> int | None: ... -def builtin_function_as_default_arg(func: type(len) = len): ... -def function_as_default_arg(func: type(search) = search): ... +def builtin_function_as_default_arg( + func: pybind11_stubgen.typing_ext.ValueExpr("type(len)") = len, +): ... +def function_as_default_arg( + func: pybind11_stubgen.typing_ext.ValueExpr("type(search)") = search, +): ... def lambda_as_default_arg(callback=...): ... def search(a: int, b: list[int]) -> int: ... def static_method_as_default_arg(callback=_Dummy.foo): ... diff --git a/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi b/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi index efb53a7..bd39444 100644 --- a/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi +++ b/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_attr.pyi @@ -1,6 +1,10 @@ from __future__ import annotations +import pybind11_stubgen.typing_ext + import demo._bindings.classes __all__ = ["value"] -value: demo._bindings.classes.Foo # value = +value: demo._bindings.classes.Foo = pybind11_stubgen.typing_ext.ValueExpr( + "" +) diff --git a/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi b/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi index 24968c9..1148e68 100644 --- a/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi +++ b/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/aliases/foreign_class_member.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + import demo._bindings.classes __all__ = ["Bar1"] @@ -9,4 +11,4 @@ __all__ = ["Bar1"] class Bar1: foo: typing.ClassVar[ demo._bindings.classes.Foo - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") diff --git a/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi b/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi index 4a3b7bd..8e23a2a 100644 --- a/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi +++ b/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/classes.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = ["Base", "CppException", "Derived", "Foo", "Outer"] class Base: @@ -34,11 +36,17 @@ class Outer: TWO """ - ONE: typing.ClassVar[Outer.Inner.NestedEnum] # value = - TWO: typing.ClassVar[Outer.Inner.NestedEnum] # value = + ONE: typing.ClassVar[ + Outer.Inner.NestedEnum + ] = pybind11_stubgen.typing_ext.ValueExpr("") + TWO: typing.ClassVar[ + Outer.Inner.NestedEnum + ] = pybind11_stubgen.typing_ext.ValueExpr("") __members__: typing.ClassVar[ dict[str, Outer.Inner.NestedEnum] - ] # value = {'ONE': , 'TWO': } + ] = pybind11_stubgen.typing_ext.ValueExpr( + "{'ONE': , 'TWO': }" + ) def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... diff --git a/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/duplicate_enum.pyi b/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/duplicate_enum.pyi index 70eae65..35badaa 100644 --- a/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/duplicate_enum.pyi +++ b/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/duplicate_enum.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = ["ConsoleForegroundColor", "Magenta", "accepts_ambiguous_enum"] class ConsoleForegroundColor: @@ -13,10 +15,12 @@ class ConsoleForegroundColor: Magenta: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") __members__: typing.ClassVar[ dict[str, ConsoleForegroundColor] - ] # value = {'Magenta': } + ] = pybind11_stubgen.typing_ext.ValueExpr( + "{'Magenta': }" + ) def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... @@ -32,6 +36,12 @@ class ConsoleForegroundColor: @property def value(self) -> int: ... -def accepts_ambiguous_enum(color: ConsoleForegroundColor = ...) -> None: ... +def accepts_ambiguous_enum( + color: ConsoleForegroundColor = pybind11_stubgen.typing_ext.InvalidExpr( + "" + ), +) -> None: ... -Magenta: ConsoleForegroundColor # value = +Magenta: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) diff --git a/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi b/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi index e3f9e10..33c8e6b 100644 --- a/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi +++ b/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/enum.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = [ "Blue", "ConsoleForegroundColor", @@ -29,22 +31,24 @@ class ConsoleForegroundColor: Blue: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") Green: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") Magenta: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") None_: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") Yellow: typing.ClassVar[ ConsoleForegroundColor - ] # value = + ] = pybind11_stubgen.typing_ext.ValueExpr("") __members__: typing.ClassVar[ dict[str, ConsoleForegroundColor] - ] # value = {'Green': , 'Yellow': , 'Blue': , 'Magenta': , 'None_': } + ] = pybind11_stubgen.typing_ext.ValueExpr( + "{'Green': , 'Yellow': , 'Blue': , 'Magenta': , 'None_': }" + ) def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... @@ -64,8 +68,18 @@ def accept_defaulted_enum( color: ConsoleForegroundColor = ConsoleForegroundColor.None_, ) -> None: ... -Blue: ConsoleForegroundColor # value = -Green: ConsoleForegroundColor # value = -Magenta: ConsoleForegroundColor # value = -None_: ConsoleForegroundColor # value = -Yellow: ConsoleForegroundColor # value = +Blue: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) +Green: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) +Magenta: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) +None_: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) +Yellow: ConsoleForegroundColor = pybind11_stubgen.typing_ext.ValueExpr( + "" +) diff --git a/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi b/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi index f61b9ca..b0cc0b8 100644 --- a/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi +++ b/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/flawed_bindings.pyi @@ -2,6 +2,7 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext import typing_extensions __all__ = [ @@ -20,10 +21,32 @@ class Enum: class Unbound: pass -def accept_unbound_enum(arg0: typing_extensions.Annotated[typing.Any, ...]) -> int: ... -def accept_unbound_enum_defaulted(x: Enum = ...) -> int: ... +def accept_unbound_enum( + arg0: typing_extensions.Annotated[ + typing.Any, + pybind11_stubgen.typing_ext.InvalidExpr("(anonymous namespace)::Enum"), + ] +) -> int: ... +def accept_unbound_enum_defaulted( + x: Enum = pybind11_stubgen.typing_ext.InvalidExpr( + "" + ), +) -> int: ... def accept_unbound_type( - arg0: tuple[typing_extensions.Annotated[typing.Any, ...], int] + arg0: tuple[ + typing_extensions.Annotated[ + typing.Any, + pybind11_stubgen.typing_ext.InvalidExpr("(anonymous namespace)::Unbound"), + ], + int, + ] +) -> int: ... +def accept_unbound_type_defaulted( + x: Unbound = pybind11_stubgen.typing_ext.InvalidExpr( + "" + ), ) -> int: ... -def accept_unbound_type_defaulted(x: Unbound = ...) -> int: ... -def get_unbound_type() -> typing_extensions.Annotated[typing.Any, ...]: ... +def get_unbound_type() -> typing_extensions.Annotated[ + typing.Any, + pybind11_stubgen.typing_ext.InvalidExpr("(anonymous namespace)::Unbound"), +]: ... diff --git a/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi b/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi index 09af4e4..029d664 100644 --- a/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi +++ b/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/issues.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing +import pybind11_stubgen.typing_ext + __all__ = ["issue_51_catastrophic_regex", "issue_73_utf8_doc_chars"] def issue_51_catastrophic_regex(arg0: int, arg1: int) -> None: @@ -21,4 +23,4 @@ def issue_73_utf8_doc_chars() -> None: values provide more damping in response. """ -_cleanup: typing.Any # value = +_cleanup: typing.Any = pybind11_stubgen.typing_ext.ValueExpr("") diff --git a/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi b/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi index eb4a85a..b049f81 100644 --- a/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi +++ b/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/_bindings/values.pyi @@ -3,6 +3,7 @@ from __future__ import annotations import datetime import numpy +import pybind11_stubgen.typing_ext from numpy import random __all__ = [ @@ -27,10 +28,14 @@ class Foo: def add_day(arg0: datetime.datetime) -> datetime.datetime: ... -foolist: list # value = [, ] -foovar: Foo # value = +foolist: list = pybind11_stubgen.typing_ext.ValueExpr( + "[, ]" +) +foovar: Foo = pybind11_stubgen.typing_ext.ValueExpr( + "" +) list_with_none: list = [None, 2, {}] none = None -t_10ms: datetime.timedelta # value = datetime.timedelta(microseconds=10000) -t_20ns: datetime.timedelta # value = datetime.timedelta(0) -t_30s: datetime.timedelta # value = datetime.timedelta(seconds=30) +t_10ms: datetime.timedelta = datetime.timedelta(microseconds=10000) +t_20ns: datetime.timedelta = datetime.timedelta(0) +t_30s: datetime.timedelta = datetime.timedelta(seconds=30) diff --git a/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi b/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi index 934f822..40a66e9 100644 --- a/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi +++ b/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/pure_python/functions.pyi @@ -3,6 +3,8 @@ from __future__ import annotations import sys as sys import typing as typing +import pybind11_stubgen.typing_ext + from demo.pure_python.functions_3_8_plus import args_mix __all__ = [ @@ -22,8 +24,12 @@ class _Dummy: def foo(): ... def accept_frozenset(arg: frozenset[int | float]) -> int | None: ... -def builtin_function_as_default_arg(func: type(len) = len): ... -def function_as_default_arg(func: type(search) = search): ... +def builtin_function_as_default_arg( + func: pybind11_stubgen.typing_ext.ValueExpr("type(len)") = len, +): ... +def function_as_default_arg( + func: pybind11_stubgen.typing_ext.ValueExpr("type(search)") = search, +): ... def lambda_as_default_arg(callback=...): ... def search(a: int, b: list[int]) -> int: ... def static_method_as_default_arg(callback=_Dummy.foo): ... diff --git a/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi b/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi index dd9ffdc..4b91799 100644 --- a/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi +++ b/tests/stubs/python-3.8/pybind11-master/numpy-array-wrap-with-annotated/demo/pure_python/functions_3_8_plus.pyi @@ -2,6 +2,8 @@ from __future__ import annotations import typing as typing +import pybind11_stubgen.typing_ext + __all__ = ["args_mix", "typing"] def args_mix( @@ -11,5 +13,5 @@ def args_mix( *args: int, x: int = 1, y=int, - **kwargs: typing.Dict[int, str], + **kwargs: pybind11_stubgen.typing_ext.ValueExpr("typing.Dict[int, str]"), ): ...