File: list.pyi

package info (click to toggle)
python-atom 0.11.0-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 1,676 kB
  • sloc: cpp: 9,254; python: 6,181; makefile: 123
file content (68 lines) | stat: -rw-r--r-- 2,333 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# --------------------------------------------------------------------------------------
# Copyright (c) 2021-2024, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# --------------------------------------------------------------------------------------
from typing import Any, List as TList, Optional, Tuple, Type, TypeVar, overload

from .catom import Member

T = TypeVar("T")
T1 = TypeVar("T1")
T2 = TypeVar("T2")

class List(Member[TList[T], TList[T]]):
    # No default
    @overload
    def __new__(
        cls, kind: None = None, default: Optional[TList[Any]] = None
    ) -> List[Any]: ...
    @overload
    def __new__(cls, kind: Type[T], default: None = None) -> List[T]: ...
    @overload
    def __new__(cls, kind: Tuple[Type[T]], default: None = None) -> List[T]: ...
    @overload
    def __new__(
        cls, kind: Tuple[Type[T], Type[T1]], default: None = None
    ) -> List[T | T1]: ...
    @overload
    def __new__(
        cls,
        kind: Tuple[Type[T], Type[T1], Type[T2]],
        default: None = None,
    ) -> List[T | T1 | T2]: ...
    @overload
    def __new__(cls, kind: Member[T, Any], default: None = None) -> List[T]: ...
    # With default
    @overload
    def __new__(cls, kind: Type[T], default: TList[T]) -> List[T]: ...
    @overload
    def __new__(cls, kind: Tuple[Type[T]], default: TList[T]) -> List[T]: ...
    @overload
    def __new__(
        cls, kind: Tuple[Type[T], Type[T1]], default: TList[T | T1]
    ) -> List[T | T1]: ...
    @overload
    def __new__(
        cls, kind: Tuple[Type[T], Type[T1]], default: TList[T] | TList[T1]
    ) -> List[T | T1]: ...
    @overload
    def __new__(
        cls, kind: Tuple[Type[T], Type[T1], Type[T2]], default: TList[T | T1 | T2]
    ) -> List[T | T1 | T2]: ...
    @overload
    def __new__(
        cls,
        kind: Tuple[Type[T], Type[T1], Type[T2]],
        default: TList[T | T1] | TList[T | T2] | TList[T1 | T2],
    ) -> List[T | T1 | T2]: ...
    @overload
    def __new__(
        cls,
        kind: Tuple[Type[T], Type[T1], Type[T2]],
        default: TList[T] | TList[T1] | TList[T2],
    ) -> List[T | T1 | T2]: ...
    @overload
    def __new__(cls, kind: Member[T, Any], default: TList[T]) -> List[T]: ...