jetpytools 1.5.0__tar.gz → 1.6.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of jetpytools might be problematic. Click here for more details.

Files changed (53) hide show
  1. jetpytools-1.6.0/.gitignore +12 -0
  2. {jetpytools-1.5.0 → jetpytools-1.6.0}/PKG-INFO +10 -23
  3. jetpytools-1.6.0/jetpytools/__init__.py +5 -0
  4. jetpytools-1.6.0/jetpytools/_metadata.py +12 -0
  5. jetpytools-1.6.0/jetpytools/enums/__init__.py +2 -0
  6. {jetpytools-1.5.0 → jetpytools-1.6.0}/jetpytools/enums/base.py +9 -8
  7. {jetpytools-1.5.0 → jetpytools-1.6.0}/jetpytools/enums/other.py +4 -9
  8. jetpytools-1.6.0/jetpytools/exceptions/__init__.py +5 -0
  9. {jetpytools-1.5.0 → jetpytools-1.6.0}/jetpytools/exceptions/base.py +34 -38
  10. jetpytools-1.6.0/jetpytools/exceptions/enum.py +12 -0
  11. {jetpytools-1.5.0 → jetpytools-1.6.0}/jetpytools/exceptions/file.py +6 -8
  12. {jetpytools-1.5.0 → jetpytools-1.6.0}/jetpytools/exceptions/generic.py +8 -6
  13. {jetpytools-1.5.0 → jetpytools-1.6.0}/jetpytools/exceptions/module.py +9 -8
  14. jetpytools-1.6.0/jetpytools/functions/__init__.py +3 -0
  15. {jetpytools-1.5.0 → jetpytools-1.6.0}/jetpytools/functions/funcs.py +21 -42
  16. {jetpytools-1.5.0 → jetpytools-1.6.0}/jetpytools/functions/normalize.py +42 -54
  17. {jetpytools-1.5.0 → jetpytools-1.6.0}/jetpytools/functions/other.py +1 -3
  18. jetpytools-1.6.0/jetpytools/types/__init__.py +7 -0
  19. jetpytools-1.6.0/jetpytools/types/builtins.py +95 -0
  20. {jetpytools-1.5.0 → jetpytools-1.6.0}/jetpytools/types/check.py +6 -9
  21. {jetpytools-1.5.0 → jetpytools-1.6.0}/jetpytools/types/file.py +89 -46
  22. {jetpytools-1.5.0 → jetpytools-1.6.0}/jetpytools/types/funcs.py +11 -28
  23. {jetpytools-1.5.0 → jetpytools-1.6.0}/jetpytools/types/generic.py +1 -11
  24. jetpytools-1.6.0/jetpytools/types/supports.py +143 -0
  25. {jetpytools-1.5.0 → jetpytools-1.6.0}/jetpytools/types/utils.py +102 -119
  26. jetpytools-1.6.0/jetpytools/utils/__init__.py +4 -0
  27. {jetpytools-1.5.0 → jetpytools-1.6.0}/jetpytools/utils/file.py +94 -69
  28. {jetpytools-1.5.0 → jetpytools-1.6.0}/jetpytools/utils/funcs.py +8 -13
  29. {jetpytools-1.5.0 → jetpytools-1.6.0}/jetpytools/utils/math.py +26 -16
  30. {jetpytools-1.5.0 → jetpytools-1.6.0}/jetpytools/utils/ranges.py +7 -11
  31. jetpytools-1.6.0/pyproject.toml +98 -0
  32. jetpytools-1.5.0/jetpytools/__init__.py +0 -5
  33. jetpytools-1.5.0/jetpytools/_metadata.py +0 -12
  34. jetpytools-1.5.0/jetpytools/enums/__init__.py +0 -2
  35. jetpytools-1.5.0/jetpytools/exceptions/__init__.py +0 -5
  36. jetpytools-1.5.0/jetpytools/exceptions/enum.py +0 -11
  37. jetpytools-1.5.0/jetpytools/functions/__init__.py +0 -3
  38. jetpytools-1.5.0/jetpytools/types/__init__.py +0 -7
  39. jetpytools-1.5.0/jetpytools/types/builtins.py +0 -76
  40. jetpytools-1.5.0/jetpytools/types/supports.py +0 -127
  41. jetpytools-1.5.0/jetpytools/utils/__init__.py +0 -4
  42. jetpytools-1.5.0/jetpytools.egg-info/PKG-INFO +0 -51
  43. jetpytools-1.5.0/jetpytools.egg-info/SOURCES.txt +0 -40
  44. jetpytools-1.5.0/jetpytools.egg-info/dependency_links.txt +0 -1
  45. jetpytools-1.5.0/jetpytools.egg-info/requires.txt +0 -1
  46. jetpytools-1.5.0/jetpytools.egg-info/top_level.txt +0 -1
  47. jetpytools-1.5.0/setup.cfg +0 -39
  48. jetpytools-1.5.0/setup.py +0 -52
  49. jetpytools-1.5.0/tests/test_funcs.py +0 -12
  50. jetpytools-1.5.0/tests/test_normalize.py +0 -63
  51. {jetpytools-1.5.0 → jetpytools-1.6.0}/LICENSE +0 -0
  52. {jetpytools-1.5.0 → jetpytools-1.6.0}/README.md +0 -0
  53. {jetpytools-1.5.0 → jetpytools-1.6.0}/jetpytools/py.typed +0 -0
@@ -0,0 +1,12 @@
1
+ .eggs/
2
+ .mypy_cache/
3
+ .vscode/
4
+ *.glsl
5
+ *.pyc
6
+ *.vpy
7
+ *.egg-info/*
8
+ /tests/dependencies/*
9
+ /tests/output/*
10
+ build/
11
+ dist/
12
+ stgpytools.egg-info/
@@ -1,36 +1,23 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jetpytools
3
- Version: 1.5.0
3
+ Version: 1.6.0
4
4
  Summary: Collection of stuff that's useful in general python programming
5
- Author: Jaded Encoding Thaumaturgy
6
- Author-email: jaded.encoding.thaumaturgy@gmail.com
7
- Maintainer: Jaded Encoding Thaumaturgy
8
- Maintainer-email: jaded.encoding.thaumaturgy@gmail.com
9
5
  Project-URL: Source Code, https://github.com/Jaded-Encoding-Thaumaturgy/jetpytools
10
6
  Project-URL: Contact, https://discord.gg/XTpc6Fa9eB
11
- Classifier: Natural Language :: English
12
- Classifier: Intended Audience :: Developers
13
- Classifier: Intended Audience :: Other Audience
14
- Classifier: Programming Language :: Python :: 3.10
7
+ Author: Jaded Encoding Thaumaturgy
8
+ Maintainer-email: Jaded Encoding Thaumaturgy <jaded.encoding.thaumaturgy@gmail.com>
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Classifier: Development Status :: 5 - Production/Stable
15
12
  Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Natural Language :: English
16
14
  Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
17
  Classifier: Typing :: Typed
18
18
  Requires-Python: >=3.10
19
+ Requires-Dist: typing-extensions>=4.12.2
19
20
  Description-Content-Type: text/markdown
20
- License-File: LICENSE
21
- Requires-Dist: typing_extensions>=4.12.2
22
- Dynamic: author
23
- Dynamic: author-email
24
- Dynamic: classifier
25
- Dynamic: description
26
- Dynamic: description-content-type
27
- Dynamic: license-file
28
- Dynamic: maintainer
29
- Dynamic: maintainer-email
30
- Dynamic: project-url
31
- Dynamic: requires-dist
32
- Dynamic: requires-python
33
- Dynamic: summary
34
21
 
35
22
  # jetpytools
36
23
 
@@ -0,0 +1,5 @@
1
+ from .enums import *
2
+ from .exceptions import *
3
+ from .functions import *
4
+ from .types import *
5
+ from .utils import *
@@ -0,0 +1,12 @@
1
+ """Collection of stuff that's useful in general python programming"""
2
+
3
+ __version__ = "1.6.0"
4
+
5
+ __author_name__, __author_email__ = "Jaded Encoding Thaumaturgy", "jaded.encoding.thaumaturgy@gmail.com"
6
+ __maintainer_name__, __maintainer_email__ = __author_name__, __author_email__
7
+
8
+ __author__ = f"{__author_name__} <{__author_email__}>"
9
+ __maintainer__ = __author__
10
+
11
+ if __name__ == "__github__":
12
+ print(__version__)
@@ -0,0 +1,2 @@
1
+ from .base import *
2
+ from .other import *
@@ -8,9 +8,7 @@ from typing_extensions import Self
8
8
  from ..exceptions import CustomValueError, NotFoundEnumValue
9
9
  from ..types import FuncExceptT
10
10
 
11
- __all__ = [
12
- 'CustomEnum', 'CustomIntEnum', 'CustomStrEnum'
13
- ]
11
+ __all__ = ["CustomEnum", "CustomIntEnum", "CustomStrEnum"]
14
12
 
15
13
 
16
14
  class CustomEnum(Enum):
@@ -43,7 +41,7 @@ class CustomEnum(Enum):
43
41
  return value
44
42
 
45
43
  if value is cls:
46
- raise CustomValueError('You must select a member, not pass the enum!', func_except)
44
+ raise CustomValueError("You must select a member, not pass the enum!", func_except)
47
45
 
48
46
  try:
49
47
  return cls(value)
@@ -57,10 +55,13 @@ class CustomEnum(Enum):
57
55
 
58
56
  raise NotFoundEnumValue(
59
57
  'The given value for "{var_name}" argument must be a valid {enum_name}, not "{value}"!\n'
60
- 'Valid values are: [{readable_enum}].', func_name,
61
- var_name=var_name, enum_name=cls, value=value,
62
- readable_enum=iter([f'{x.name} ({x.value})' for x in cls]),
63
- reason=value
58
+ "Valid values are: [{readable_enum}].",
59
+ func_name,
60
+ var_name=var_name,
61
+ enum_name=cls,
62
+ value=value,
63
+ readable_enum=iter([f"{x.name} ({x.value})" for x in cls]),
64
+ reason=value,
64
65
  )
65
66
 
66
67
 
@@ -1,13 +1,10 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  from typing import overload
4
+
4
5
  from typing_extensions import Self
5
6
 
6
- __all__ = [
7
- 'Coordinate',
8
- 'Position',
9
- 'Size'
10
- ]
7
+ __all__ = ["Coordinate", "Position", "Size"]
11
8
 
12
9
 
13
10
  class Coordinate:
@@ -24,12 +21,10 @@ class Coordinate:
24
21
  """Vertical coordinate."""
25
22
 
26
23
  @overload
27
- def __init__(self, other: tuple[int, int] | Self, /) -> None:
28
- ...
24
+ def __init__(self, other: tuple[int, int] | Self, /) -> None: ...
29
25
 
30
26
  @overload
31
- def __init__(self, x: int, y: int, /) -> None:
32
- ...
27
+ def __init__(self, x: int, y: int, /) -> None: ...
33
28
 
34
29
  def __init__(self, x_or_self: int | tuple[int, int] | Self, y: int | None = None, /) -> None:
35
30
  from ..exceptions import CustomValueError
@@ -0,0 +1,5 @@
1
+ from .base import *
2
+ from .enum import *
3
+ from .file import *
4
+ from .generic import *
5
+ from .module import *
@@ -1,45 +1,43 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import sys
4
-
5
4
  from copy import deepcopy
6
5
  from typing import TYPE_CHECKING, Any, TypeVar
7
6
 
8
7
  from typing_extensions import Self
9
8
 
10
- from ..types import MISSING, FuncExceptT, SupportsString, MissingT
9
+ from ..types import MISSING, FuncExceptT, MissingT, SupportsString
11
10
 
12
11
  __all__ = [
13
- 'CustomError',
14
-
15
- 'CustomValueError',
16
- 'CustomIndexError',
17
- 'CustomOverflowError',
18
- 'CustomKeyError',
19
- 'CustomTypeError',
20
- 'CustomRuntimeError',
21
- 'CustomNotImplementedError',
22
- 'CustomPermissionError'
12
+ "CustomError",
13
+ "CustomIndexError",
14
+ "CustomKeyError",
15
+ "CustomNotImplementedError",
16
+ "CustomOverflowError",
17
+ "CustomPermissionError",
18
+ "CustomRuntimeError",
19
+ "CustomTypeError",
20
+ "CustomValueError",
23
21
  ]
24
22
 
25
23
 
26
24
  if TYPE_CHECKING:
27
- class ExceptionT(Exception):
25
+
26
+ class ExceptionError(Exception):
28
27
  __name__: str
29
28
  __qualname__: str
30
- ...
31
29
  else:
32
- ExceptionT = Exception
30
+ ExceptionError = Exception
33
31
 
34
32
 
35
33
  class CustomErrorMeta(type):
36
34
  """Custom base exception meta class."""
37
35
 
38
36
  def __new__(cls: type[SelfCErrorMeta], *args: Any) -> SelfCErrorMeta:
39
- return CustomErrorMeta.setup_exception(type.__new__(cls, *args)) # type: ignore
37
+ return CustomErrorMeta.setup_exception(type.__new__(cls, *args)) # pyright: ignore[reportReturnType]
40
38
 
41
39
  @staticmethod
42
- def setup_exception(exception: SelfCErrorMeta, override: str | ExceptionT | None = None) -> SelfCErrorMeta:
40
+ def setup_exception(exception: SelfCErrorMeta, override: str | ExceptionError | None = None) -> SelfCErrorMeta:
43
41
  """
44
42
  Setup an exception for later use in CustomError.
45
43
 
@@ -55,28 +53,28 @@ class CustomErrorMeta(type):
55
53
  else:
56
54
  over_name, over_qual = override.__name__, override.__qualname__
57
55
 
58
- if over_name.startswith('Custom'):
56
+ if over_name.startswith("Custom"):
59
57
  exception.__name__ = over_name
60
58
  else:
61
- exception.__name__ = f'Custom{over_name}'
59
+ exception.__name__ = f"Custom{over_name}"
62
60
 
63
61
  exception.__qualname__ = over_qual
64
62
 
65
- if exception.__qualname__.startswith('Custom'):
63
+ if exception.__qualname__.startswith("Custom"):
66
64
  exception.__qualname__ = exception.__qualname__[6:]
67
65
 
68
66
  if sys.stdout and sys.stdout.isatty():
69
- exception.__qualname__ = f'\033[0;31;1m{exception.__qualname__}\033[0m'
67
+ exception.__qualname__ = f"\033[0;31;1m{exception.__qualname__}\033[0m"
70
68
 
71
69
  exception.__module__ = Exception.__module__
72
70
 
73
71
  return exception
74
72
 
75
73
 
76
- SelfCErrorMeta = TypeVar('SelfCErrorMeta', bound=CustomErrorMeta)
74
+ SelfCErrorMeta = TypeVar("SelfCErrorMeta", bound=CustomErrorMeta)
77
75
 
78
76
 
79
- class CustomError(ExceptionT, metaclass=CustomErrorMeta):
77
+ class CustomError(ExceptionError, metaclass=CustomErrorMeta):
80
78
  """Custom base exception class."""
81
79
 
82
80
  def __init__(
@@ -97,7 +95,7 @@ class CustomError(ExceptionT, metaclass=CustomErrorMeta):
97
95
 
98
96
  super().__init__(message)
99
97
 
100
- def __class_getitem__(cls, exception: str | type[ExceptionT] | ExceptionT) -> CustomError:
98
+ def __class_getitem__(cls, exception: str | type[ExceptionError] | ExceptionError) -> CustomError:
101
99
  from warnings import warn
102
100
 
103
101
  warn("Custom error is not subscriptable anymore. Don't use it", DeprecationWarning)
@@ -109,7 +107,7 @@ class CustomError(ExceptionT, metaclass=CustomErrorMeta):
109
107
  message: SupportsString | None | MissingT = MISSING,
110
108
  func: FuncExceptT | None | MissingT = MISSING,
111
109
  reason: SupportsString | FuncExceptT | None | MissingT = MISSING,
112
- **kwargs: Any
110
+ **kwargs: Any,
113
111
  ) -> Self:
114
112
  """
115
113
  Copy an existing exception with defaults and instantiate a new one.
@@ -140,40 +138,38 @@ class CustomError(ExceptionT, metaclass=CustomErrorMeta):
140
138
  message = self.message
141
139
 
142
140
  if not message:
143
- message = 'An error occurred!'
141
+ message = "An error occurred!"
144
142
 
145
143
  if self.func:
146
144
  func_header = norm_func_name(self.func).strip()
147
145
 
148
146
  if sys.stdout and sys.stdout.isatty():
149
- func_header = f'\033[0;36m{func_header}\033[0m'
147
+ func_header = f"\033[0;36m{func_header}\033[0m"
150
148
 
151
- func_header = f'({func_header}) '
149
+ func_header = f"({func_header}) "
152
150
  else:
153
- func_header = ''
151
+ func_header = ""
154
152
 
155
153
  if self.kwargs:
156
- self.kwargs = {
157
- key: norm_display_name(value) for key, value in self.kwargs.items()
158
- }
154
+ self.kwargs = {key: norm_display_name(value) for key, value in self.kwargs.items()}
159
155
 
160
156
  if self.reason:
161
157
  reason = self.reason = norm_display_name(self.reason)
162
158
 
163
159
  if reason:
164
160
  if not isinstance(self.reason, dict):
165
- reason = f'({reason})'
161
+ reason = f"({reason})"
166
162
 
167
163
  if sys.stdout and sys.stdout.isatty():
168
- reason = f'\033[0;33m{reason}\033[0m'
169
- reason = f' {reason}'
164
+ reason = f"\033[0;33m{reason}\033[0m"
165
+ reason = f" {reason}"
170
166
  else:
171
- reason = ''
167
+ reason = ""
172
168
 
173
- return f'{func_header}{self.message!s}{reason}'.format(**self.kwargs).strip()
169
+ return f"{func_header}{self.message!s}{reason}".format(**self.kwargs).strip()
174
170
 
175
171
 
176
- SelfError = TypeVar('SelfError', bound=CustomError)
172
+ SelfError = TypeVar("SelfError", bound=CustomError)
177
173
 
178
174
 
179
175
  class CustomValueError(CustomError, ValueError):
@@ -0,0 +1,12 @@
1
+ from __future__ import annotations
2
+
3
+ from .base import CustomKeyError
4
+
5
+ __all__ = ["NotFoundEnumValue", "NotFoundEnumValueError"]
6
+
7
+
8
+ class NotFoundEnumValueError(CustomKeyError):
9
+ """Raised when you try to instantiate an Enum with unknown value"""
10
+
11
+
12
+ NotFoundEnumValue = NotFoundEnumValueError
@@ -2,15 +2,13 @@ from __future__ import annotations
2
2
 
3
3
  from .base import CustomError, CustomPermissionError
4
4
 
5
-
6
5
  __all__ = [
7
- 'FileNotExistsError',
8
- 'FileWasNotFoundError',
9
- 'FilePermissionError',
10
- 'FileTypeMismatchError',
11
- 'FileIsADirectoryError',
12
-
13
- 'PathIsNotADirectoryError',
6
+ "FileIsADirectoryError",
7
+ "FileNotExistsError",
8
+ "FilePermissionError",
9
+ "FileTypeMismatchError",
10
+ "FileWasNotFoundError",
11
+ "PathIsNotADirectoryError",
14
12
  ]
15
13
 
16
14
 
@@ -5,9 +5,7 @@ from typing import Any, Iterable
5
5
  from ..types import FuncExceptT, SupportsString, T
6
6
  from .base import CustomValueError
7
7
 
8
- __all__ = [
9
- 'MismatchError', 'MismatchRefError'
10
- ]
8
+ __all__ = ["MismatchError", "MismatchRefError"]
11
9
 
12
10
 
13
11
  class MismatchError(CustomValueError):
@@ -22,8 +20,12 @@ class MismatchError(CustomValueError):
22
20
  return tuple(dict.fromkeys(map(cls._item_to_name, items)).keys())
23
21
 
24
22
  def __init__(
25
- self, func: FuncExceptT, items: Iterable[Any], message: SupportsString = 'All items must be equal!',
26
- reason: Any = '{reduced_items}', **kwargs: Any
23
+ self,
24
+ func: FuncExceptT,
25
+ items: Iterable[Any],
26
+ message: SupportsString = "All items must be equal!",
27
+ reason: Any = "{reduced_items}",
28
+ **kwargs: Any,
27
29
  ) -> None:
28
30
  super().__init__(message, func, reason, **kwargs, reduced_items=iter(self._reduce(items)))
29
31
 
@@ -35,7 +37,7 @@ class MismatchError(CustomValueError):
35
37
 
36
38
  class MismatchRefError(MismatchError):
37
39
  def __init__(
38
- self, func: FuncExceptT, base: T, ref: T, message: SupportsString = 'All items must be equal!', **kwargs: Any
40
+ self, func: FuncExceptT, base: T, ref: T, message: SupportsString = "All items must be equal!", **kwargs: Any
39
41
  ) -> None:
40
42
  super().__init__(func, [base, ref], message, **kwargs)
41
43
 
@@ -5,19 +5,18 @@ from typing import Any
5
5
  from ..types import FuncExceptT, SupportsString
6
6
  from .base import CustomError
7
7
 
8
- __all__ = [
9
- 'CustomImportError',
10
- 'DependencyNotFoundError'
11
- ]
8
+ __all__ = ["CustomImportError", "DependencyNotFoundError"]
12
9
 
13
10
 
14
11
  class CustomImportError(CustomError, ImportError):
15
12
  """Raised when there's a general import error."""
16
13
 
17
14
  def __init__(
18
- self, func: FuncExceptT, package: str | ImportError,
15
+ self,
16
+ func: FuncExceptT,
17
+ package: str | ImportError,
19
18
  message: SupportsString = "Import failed for package '{package}'!",
20
- **kwargs: Any
19
+ **kwargs: Any,
21
20
  ) -> None:
22
21
  """
23
22
  :param func: Function this error was raised from.
@@ -32,8 +31,10 @@ class DependencyNotFoundError(CustomImportError):
32
31
  """Raised when there's a missing optional dependency."""
33
32
 
34
33
  def __init__(
35
- self, func: FuncExceptT, package: str | ImportError,
34
+ self,
35
+ func: FuncExceptT,
36
+ package: str | ImportError,
36
37
  message: SupportsString = "Missing dependency '{package}'!",
37
- **kwargs: Any
38
+ **kwargs: Any,
38
39
  ) -> None:
39
40
  super().__init__(func, package, message, **kwargs)
@@ -0,0 +1,3 @@
1
+ from .funcs import *
2
+ from .normalize import *
3
+ from .other import *
@@ -1,19 +1,16 @@
1
1
  from __future__ import annotations
2
2
 
3
- from typing import Any, Callable, Concatenate, overload
4
3
  from inspect import signature
4
+ from typing import Any, Callable, Concatenate, overload
5
5
 
6
6
  from ..exceptions import CustomRuntimeError, CustomValueError
7
7
  from ..types import MISSING, KwargsT, MissingT, P, R, T
8
8
 
9
- __all__ = [
10
- 'iterate', 'fallback', 'kwargs_fallback', 'filter_kwargs'
11
- ]
9
+ __all__ = ["fallback", "filter_kwargs", "iterate", "kwargs_fallback"]
12
10
 
13
11
 
14
12
  def iterate(
15
- base: T, function: Callable[Concatenate[T | R, P], R],
16
- count: int, *args: P.args, **kwargs: P.kwargs
13
+ base: T, function: Callable[Concatenate[T | R, P], R], count: int, *args: P.args, **kwargs: P.kwargs
17
14
  ) -> T | R:
18
15
  """
19
16
  Execute a given function over the base value multiple times.
@@ -51,28 +48,23 @@ fallback_missing = object()
51
48
 
52
49
 
53
50
  @overload
54
- def fallback(value: T | None, fallback: T, /) -> T:
55
- ...
51
+ def fallback(value: T | None, fallback: T, /) -> T: ...
56
52
 
57
53
 
58
54
  @overload
59
- def fallback(value: T | None, fallback0: T | None, default: T, /) -> T:
60
- ...
55
+ def fallback(value: T | None, fallback0: T | None, default: T, /) -> T: ...
61
56
 
62
57
 
63
58
  @overload
64
- def fallback(value: T | None, fallback0: T | None, fallback1: T | None, default: T, /) -> T:
65
- ...
59
+ def fallback(value: T | None, fallback0: T | None, fallback1: T | None, default: T, /) -> T: ...
66
60
 
67
61
 
68
62
  @overload
69
- def fallback(value: T | None, *fallbacks: T | None) -> T | MissingT:
70
- ...
63
+ def fallback(value: T | None, *fallbacks: T | None) -> T | MissingT: ...
71
64
 
72
65
 
73
66
  @overload
74
- def fallback(value: T | None, *fallbacks: T | None, default: T) -> T:
75
- ...
67
+ def fallback(value: T | None, *fallbacks: T | None, default: T) -> T: ...
76
68
 
77
69
 
78
70
  def fallback(value: T | None, *fallbacks: T | None, default: Any | T = fallback_missing) -> T | MissingT:
@@ -106,47 +98,36 @@ def fallback(value: T | None, *fallbacks: T | None, default: Any | T = fallback_
106
98
  elif len(fallbacks) > 3:
107
99
  return MISSING
108
100
 
109
- raise CustomRuntimeError('You need to specify a default/fallback value!')
101
+ raise CustomRuntimeError("You need to specify a default/fallback value!")
110
102
 
111
103
 
112
104
  @overload
113
- def kwargs_fallback(
114
- input_value: T | None, kwargs: tuple[KwargsT, str], fallback: T
115
- ) -> T:
116
- ...
105
+ def kwargs_fallback(input_value: T | None, kwargs: tuple[KwargsT, str], fallback: T) -> T: ...
117
106
 
118
107
 
119
108
  @overload
120
- def kwargs_fallback(
121
- input_value: T | None, kwargs: tuple[KwargsT, str], fallback0: T | None, default: T
122
- ) -> T:
123
- ...
109
+ def kwargs_fallback(input_value: T | None, kwargs: tuple[KwargsT, str], fallback0: T | None, default: T) -> T: ...
124
110
 
125
111
 
126
112
  @overload
127
113
  def kwargs_fallback(
128
- input_value: T | None, kwargs: tuple[KwargsT, str], fallback0: T | None, fallback1: T | None,
129
- default: T
130
- ) -> T:
131
- ...
114
+ input_value: T | None, kwargs: tuple[KwargsT, str], fallback0: T | None, fallback1: T | None, default: T
115
+ ) -> T: ...
132
116
 
133
117
 
134
118
  @overload
135
- def kwargs_fallback(
136
- input_value: T | None, kwargs: tuple[KwargsT, str], *fallbacks: T | None
137
- ) -> T | MissingT:
138
- ...
119
+ def kwargs_fallback(input_value: T | None, kwargs: tuple[KwargsT, str], *fallbacks: T | None) -> T | MissingT: ...
139
120
 
140
121
 
141
122
  @overload
142
- def kwargs_fallback(
143
- input_value: T | None, kwargs: tuple[KwargsT, str], *fallbacks: T | None, default: T
144
- ) -> T:
145
- ...
123
+ def kwargs_fallback(input_value: T | None, kwargs: tuple[KwargsT, str], *fallbacks: T | None, default: T) -> T: ...
146
124
 
147
125
 
148
126
  def kwargs_fallback( # type: ignore
149
- value: T | None, kwargs: tuple[KwargsT, str], *fallbacks: T | None, default: T = fallback_missing # type: ignore
127
+ value: T | None,
128
+ kwargs: tuple[KwargsT, str],
129
+ *fallbacks: T | None,
130
+ default: T = fallback_missing, # type: ignore
150
131
  ) -> T | MissingT:
151
132
  """Utility function to return a fallback value from kwargs if value was not found or is None."""
152
133
 
@@ -154,13 +135,11 @@ def kwargs_fallback( # type: ignore
154
135
 
155
136
 
156
137
  @overload
157
- def filter_kwargs(func: Callable[..., Any], kwargs: dict[str, Any]) -> dict[str, Any]:
158
- ...
138
+ def filter_kwargs(func: Callable[..., Any], kwargs: dict[str, Any]) -> dict[str, Any]: ...
159
139
 
160
140
 
161
141
  @overload
162
- def filter_kwargs(func: Callable[..., Any], **kwargs: Any) -> dict[str, Any]:
163
- ...
142
+ def filter_kwargs(func: Callable[..., Any], **kwargs: Any) -> dict[str, Any]: ...
164
143
 
165
144
 
166
145
  def filter_kwargs(func: Callable[..., Any], kwargs: dict[str, Any] | None = None, **kw: Any) -> dict[str, Any]: