pipelex-sdk 0.1.0__py3-none-any.whl

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.
File without changes
pipelex_sdk/_compat.py ADDED
@@ -0,0 +1,10 @@
1
+ import sys
2
+
3
+ if sys.version_info >= (3, 11):
4
+ from enum import StrEnum
5
+ from typing import Self
6
+ else:
7
+ from backports.strenum import StrEnum # type: ignore[import-not-found, no-redef]
8
+ from typing_extensions import Self # type: ignore[assignment]
9
+
10
+ __all__ = ["Self", "StrEnum"]
@@ -0,0 +1,15 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING, TypeVar
4
+
5
+ if TYPE_CHECKING:
6
+ from collections.abc import Callable
7
+
8
+ T = TypeVar("T")
9
+
10
+
11
+ def empty_list_factory_of(_: type[T]) -> Callable[[], list[T]]:
12
+ def _factory() -> list[T]:
13
+ return []
14
+
15
+ return _factory