massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / coc-python-data / languageServer.0.5.59 / Typeshed / stdlib / 2and3 / numbers.pyi
1 # Stubs for numbers (Python 3.5)\r
2 # See https://docs.python.org/2.7/library/numbers.html\r
3 # and https://docs.python.org/3/library/numbers.html\r
4 #\r
5 # Note: these stubs are incomplete. The more complex type\r
6 # signatures are currently omitted.\r
7 \r
8 from typing import Optional, SupportsFloat\r
9 from abc import ABCMeta, abstractmethod\r
10 import sys\r
11 \r
12 class Number(metaclass=ABCMeta):\r
13     @abstractmethod\r
14     def __hash__(self) -> int: ...\r
15 \r
16 class Complex(Number):\r
17     @abstractmethod\r
18     def __complex__(self) -> complex: ...\r
19     if sys.version_info >= (3, 0):\r
20         def __bool__(self) -> bool: ...\r
21     else:\r
22         def __nonzero__(self) -> bool: ...\r
23     @property\r
24     @abstractmethod\r
25     def real(self): ...\r
26     @property\r
27     @abstractmethod\r
28     def imag(self): ...\r
29     @abstractmethod\r
30     def __add__(self, other): ...\r
31     @abstractmethod\r
32     def __radd__(self, other): ...\r
33     @abstractmethod\r
34     def __neg__(self): ...\r
35     @abstractmethod\r
36     def __pos__(self): ...\r
37     def __sub__(self, other): ...\r
38     def __rsub__(self, other): ...\r
39     @abstractmethod\r
40     def __mul__(self, other): ...\r
41     @abstractmethod\r
42     def __rmul__(self, other): ...\r
43     if sys.version_info < (3, 0):\r
44         @abstractmethod\r
45         def __div__(self, other): ...\r
46         @abstractmethod\r
47         def __rdiv__(self, other): ...\r
48     @abstractmethod\r
49     def __truediv__(self, other): ...\r
50     @abstractmethod\r
51     def __rtruediv__(self, other): ...\r
52     @abstractmethod\r
53     def __pow__(self, exponent): ...\r
54     @abstractmethod\r
55     def __rpow__(self, base): ...\r
56     def __abs__(self): ...\r
57     def conjugate(self): ...\r
58     def __eq__(self, other: object) -> bool: ...\r
59     if sys.version_info < (3, 0):\r
60         def __ne__(self, other: object) -> bool: ...\r
61 \r
62 class Real(Complex, SupportsFloat):\r
63     @abstractmethod\r
64     def __float__(self) -> float: ...\r
65     @abstractmethod\r
66     def __trunc__(self) -> int: ...\r
67     if sys.version_info >= (3, 0):\r
68         @abstractmethod\r
69         def __floor__(self) -> int: ...\r
70         @abstractmethod\r
71         def __ceil__(self) -> int: ...\r
72         @abstractmethod\r
73         def __round__(self, ndigits: Optional[int] = ...): ...\r
74     def __divmod__(self, other): ...\r
75     def __rdivmod__(self, other): ...\r
76     @abstractmethod\r
77     def __floordiv__(self, other): ...\r
78     @abstractmethod\r
79     def __rfloordiv__(self, other): ...\r
80     @abstractmethod\r
81     def __mod__(self, other): ...\r
82     @abstractmethod\r
83     def __rmod__(self, other): ...\r
84     @abstractmethod\r
85     def __lt__(self, other) -> bool: ...\r
86     @abstractmethod\r
87     def __le__(self, other) -> bool: ...\r
88     def __complex__(self) -> complex: ...\r
89     @property\r
90     def real(self): ...\r
91     @property\r
92     def imag(self): ...\r
93     def conjugate(self): ...\r
94 \r
95 class Rational(Real):\r
96     @property\r
97     @abstractmethod\r
98     def numerator(self) -> int: ...\r
99     @property\r
100     @abstractmethod\r
101     def denominator(self) -> int: ...\r
102     def __float__(self) -> float: ...\r
103 \r
104 class Integral(Rational):\r
105     if sys.version_info >= (3, 0):\r
106         @abstractmethod\r
107         def __int__(self) -> int: ...\r
108     else:\r
109         @abstractmethod\r
110         def __long__(self) -> long: ...\r
111     def __index__(self) -> int: ...\r
112     @abstractmethod\r
113     def __pow__(self, exponent, modulus=None): ...\r
114     @abstractmethod\r
115     def __lshift__(self, other): ...\r
116     @abstractmethod\r
117     def __rlshift__(self, other): ...\r
118     @abstractmethod\r
119     def __rshift__(self, other): ...\r
120     @abstractmethod\r
121     def __rrshift__(self, other): ...\r
122     @abstractmethod\r
123     def __and__(self, other): ...\r
124     @abstractmethod\r
125     def __rand__(self, other): ...\r
126     @abstractmethod\r
127     def __xor__(self, other): ...\r
128     @abstractmethod\r
129     def __rxor__(self, other): ...\r
130     @abstractmethod\r
131     def __or__(self, other): ...\r
132     @abstractmethod\r
133     def __ror__(self, other): ...\r
134     @abstractmethod\r
135     def __invert__(self): ...\r
136     def __float__(self) -> float: ...\r
137     @property\r
138     def numerator(self) -> int: ...\r
139     @property\r
140     def denominator(self) -> int: ...\r