1
1
from datetime import datetime , timedelta
2
+ from decimal import Decimal
2
3
from typing import Any , Callable , Dict , Iterator , List , Optional , Sequence , Set , Tuple , Type , TypeVar , Union , Iterable
3
4
4
5
from django .db .models .lookups import Lookup
@@ -15,6 +16,8 @@ class SQLiteNumericMixin:
15
16
16
17
_Self = TypeVar ("_Self" )
17
18
19
+ _Numeric = Union [float , Decimal ]
20
+
18
21
class Combinable :
19
22
ADD : str = ...
20
23
SUB : str = ...
@@ -27,25 +30,25 @@ class Combinable:
27
30
BITLEFTSHIFT : str = ...
28
31
BITRIGHTSHIFT : str = ...
29
32
def __neg__ (self : _Self ) -> _Self : ...
30
- def __add__ (self : _Self , other : Optional [Union [timedelta , Combinable , float , str ]]) -> _Self : ...
31
- def __sub__ (self : _Self , other : Union [timedelta , Combinable , float ]) -> _Self : ...
32
- def __mul__ (self : _Self , other : Union [timedelta , Combinable , float ]) -> _Self : ...
33
- def __truediv__ (self : _Self , other : Union [Combinable , float ]) -> _Self : ...
34
- def __itruediv__ (self : _Self , other : Union [Combinable , float ]) -> _Self : ...
33
+ def __add__ (self : _Self , other : Optional [Union [timedelta , Combinable , _Numeric , str ]]) -> _Self : ...
34
+ def __sub__ (self : _Self , other : Union [timedelta , Combinable , _Numeric ]) -> _Self : ...
35
+ def __mul__ (self : _Self , other : Union [timedelta , Combinable , _Numeric ]) -> _Self : ...
36
+ def __truediv__ (self : _Self , other : Union [Combinable , _Numeric ]) -> _Self : ...
37
+ def __itruediv__ (self : _Self , other : Union [Combinable , _Numeric ]) -> _Self : ...
35
38
def __mod__ (self : _Self , other : Union [int , Combinable ]) -> _Self : ...
36
- def __pow__ (self : _Self , other : Union [float , Combinable ]) -> _Self : ...
39
+ def __pow__ (self : _Self , other : Union [_Numeric , Combinable ]) -> _Self : ...
37
40
def __and__ (self : _Self , other : Combinable ) -> _Self : ...
38
41
def bitand (self : _Self , other : int ) -> _Self : ...
39
42
def bitleftshift (self : _Self , other : int ) -> _Self : ...
40
43
def bitrightshift (self : _Self , other : int ) -> _Self : ...
41
44
def __or__ (self : _Self , other : Combinable ) -> _Self : ...
42
45
def bitor (self : _Self , other : int ) -> _Self : ...
43
- def __radd__ (self , other : Optional [Union [datetime , float , Combinable ]]) -> Combinable : ...
44
- def __rsub__ (self , other : Union [float , Combinable ]) -> Combinable : ...
45
- def __rmul__ (self , other : Union [float , Combinable ]) -> Combinable : ...
46
- def __rtruediv__ (self , other : Union [float , Combinable ]) -> Combinable : ...
46
+ def __radd__ (self , other : Optional [Union [datetime , _Numeric , Combinable ]]) -> Combinable : ...
47
+ def __rsub__ (self , other : Union [_Numeric , Combinable ]) -> Combinable : ...
48
+ def __rmul__ (self , other : Union [_Numeric , Combinable ]) -> Combinable : ...
49
+ def __rtruediv__ (self , other : Union [_Numeric , Combinable ]) -> Combinable : ...
47
50
def __rmod__ (self , other : Union [int , Combinable ]) -> Combinable : ...
48
- def __rpow__ (self , other : Union [float , Combinable ]) -> Combinable : ...
51
+ def __rpow__ (self , other : Union [_Numeric , Combinable ]) -> Combinable : ...
49
52
def __rand__ (self , other : Any ) -> Combinable : ...
50
53
def __ror__ (self , other : Any ) -> Combinable : ...
51
54
0 commit comments