Skip to content

Commit 13e1d08

Browse files
ziesemerJosverl
authored andcommitted
Add @typing.override.
- Provides compatibility as introduced with Python 3.12 / PEP 698. - https://peps.python.org/pep-0698/
1 parent 28911b6 commit 13e1d08

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

mip/typing.mpy

-20 Bytes
Binary file not shown.

mip/typing.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
__version__ = "1.26.1"
1+
__version__ = "1.27.0"
2+
23

34
def cast(type, val):
45
return val
@@ -20,6 +21,10 @@ def overload(func):
2021
return None
2122

2223

24+
def override(func):
25+
return func
26+
27+
2328
class _AnyCall:
2429
def __init__(*args, **kwargs):
2530
pass
@@ -30,6 +35,7 @@ def __call__(*args, **kwargs):
3035
def __getitem__(self, arg):
3136
return _anyCall
3237

38+
3339
_anyCall = _AnyCall()
3440

3541

@@ -41,7 +47,7 @@ def __getitem__(self, arg):
4147
_Subscriptable = _SubscriptableType()
4248

4349

44-
def TypeVar(name, *types, bound: Any | None = None, covariant = False, contravariant = False, infer_variance = False):
50+
def TypeVar(name, *types, bound: Any | None = None, covariant=False, contravariant=False, infer_variance=False):
4551
return None
4652

4753

@@ -125,7 +131,6 @@ class Protocol:
125131
# Pattern = str
126132
# Match = str
127133

128-
129134
AbstractSet = _Subscriptable
130135
AsyncContextManager = _Subscriptable
131136
AsyncGenerator = _Subscriptable

mip/typing_extensions.mpy

-20 Bytes
Binary file not shown.

mip/typing_extensions.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
__version__ = "1.24.1.post2"
1+
__version__ = "1.27.0"
2+
23

34
def cast(type, val):
45
return val
@@ -20,6 +21,10 @@ def overload(func):
2021
return None
2122

2223

24+
def override(func):
25+
return func
26+
27+
2328
class _AnyCall:
2429
def __init__(*args, **kwargs):
2530
pass
@@ -30,6 +35,7 @@ def __call__(*args, **kwargs):
3035
def __getitem__(self, arg):
3136
return _anyCall
3237

38+
3339
_anyCall = _AnyCall()
3440

3541

@@ -41,7 +47,7 @@ def __getitem__(self, arg):
4147
_Subscriptable = _SubscriptableType()
4248

4349

44-
def TypeVar(name, *types, bound: Any | None = None, covariant = False, contravariant = False, infer_variance = False):
50+
def TypeVar(name, *types, bound: Any | None = None, covariant=False, contravariant=False, infer_variance=False):
4551
return None
4652

4753

@@ -118,11 +124,13 @@ class Protocol:
118124

119125

120126
AnyStr = str
121-
Text = str
122-
Pattern = str
123-
Match = str
124127
TypedDict = dict
125128

129+
# Deprecated
130+
# Text = str
131+
# Pattern = str
132+
# Match = str
133+
126134
AbstractSet = _Subscriptable
127135
AsyncContextManager = _Subscriptable
128136
AsyncGenerator = _Subscriptable

0 commit comments

Comments
 (0)