File: test_typing_ext.pyi.ref

package info (click to toggle)
nanobind 2.11.0-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,300 kB
  • sloc: cpp: 12,232; python: 6,315; ansic: 4,813; makefile: 22; sh: 15
file content (80 lines) | stat: -rw-r--r-- 1,526 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
from collections.abc import Iterable
import py_stub_test
from typing import Any, Generic, Optional, Self, TypeAlias, TypeVar

from . import submodule as submodule
from .submodule import F as F, f as f2


# a prefix

class Foo:
    # a class prefix

    def __lt__(self, arg: int, /) -> bool: ...

    def __gt__(self, arg: int, /) -> bool: ...

    def __le__(self, arg: Foo, /) -> bool: ...

    def __ge__(self, arg: Foo, /) -> bool: ...

    lt_alias = __lt__

    # a class suffix

def f() -> None: ...

def makeNestedClass() -> py_stub_test.AClass.NestedClass: ...

AnyTuple: TypeAlias = tuple[Any, ...]

FooAlias: TypeAlias = Foo

f_alias = f

@my_decorator
class CustomSignature(Iterable[int]):
    @my_decorator
    def method(self: Self): ...

    def method_with_default(self, value: bool = bool(True)) -> None: ...

    @property
    def value(self, /) -> Optional[int]:
        """docstring for getter"""

    @value.setter
    def value(self, value: Optional[int], /) -> None:
        """docstring for setter"""

pytree: dict = ...

T = TypeVar("T", contravariant=True)

class Wrapper(Generic[T]):
    def __init__(self, arg: T, /) -> None: ...

    def get(self, /) -> T: ...

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

class WrapperFoo(Wrapper[Foo]):
    pass

class WrapperTypeParam[T]:
    pass

def list_front[T](arg: list[T], /) -> T: ...

T2 = TypeVar("T2", bound=Foo)

T3 = TypeVar("T3", Foo, Wrapper)

def tweak_me(arg: int):
    """
    prior docstring
    remains preserved
    """

# a suffix