in2 0.1.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.
- in2-0.1.0/PKG-INFO +10 -0
- in2-0.1.0/README.md +0 -0
- in2-0.1.0/pyproject.toml +22 -0
- in2-0.1.0/pyproject.toml.orig +23 -0
- in2-0.1.0/src/in2/__init__.py +2 -0
- in2-0.1.0/src/in2/into.py +21 -0
in2-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: in2
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Easily casting the type of an object.
|
|
5
|
+
Author: Sequence
|
|
6
|
+
Author-email: Sequence <3863887959@qq.com>
|
|
7
|
+
Requires-Dist: rezult>=0.2.1
|
|
8
|
+
Requires-Python: >=3.12
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
|
in2-0.1.0/README.md
ADDED
|
File without changes
|
in2-0.1.0/pyproject.toml
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "in2"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Easily casting the type of an object."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.12"
|
|
7
|
+
dependencies = ["rezult>=0.2.1"]
|
|
8
|
+
|
|
9
|
+
[[project.authors]]
|
|
10
|
+
name = "Sequence"
|
|
11
|
+
email = "3863887959@qq.com"
|
|
12
|
+
|
|
13
|
+
[project.scripts]
|
|
14
|
+
in2 = "in2:main"
|
|
15
|
+
|
|
16
|
+
[[tool.uv.index]]
|
|
17
|
+
url = "https://pypi.tuna.tsinghua.edu.cn/simple"
|
|
18
|
+
default = true
|
|
19
|
+
|
|
20
|
+
[build-system]
|
|
21
|
+
requires = ["uv_build>=0.13.6,<0.14.0"]
|
|
22
|
+
build-backend = "uv_build"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "in2"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Easily casting the type of an object."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
authors = [
|
|
7
|
+
{ name = "Sequence", email = "3863887959@qq.com" }
|
|
8
|
+
]
|
|
9
|
+
requires-python = ">=3.12"
|
|
10
|
+
dependencies = [
|
|
11
|
+
"rezult>=0.2.1",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
[project.scripts]
|
|
15
|
+
in2 = "in2:main"
|
|
16
|
+
|
|
17
|
+
[[tool.uv.index]]
|
|
18
|
+
url = "https://pypi.tuna.tsinghua.edu.cn/simple"
|
|
19
|
+
default = true
|
|
20
|
+
|
|
21
|
+
[build-system]
|
|
22
|
+
requires = ["uv_build>=0.13.6,<0.14.0"]
|
|
23
|
+
build-backend = "uv_build"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from typing import Protocol
|
|
2
|
+
|
|
3
|
+
from rezult import Result
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Into[T](Protocol):
|
|
7
|
+
def __into__(self, into: type[T]) -> T:
|
|
8
|
+
raise NotImplementedError
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def into[T](from_: Into[T], to: type[T]) -> T:
|
|
12
|
+
return from_.__into__(to)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class TryInto[T, E](Protocol):
|
|
16
|
+
def __try_into__(self, into: type[T]) -> Result[T, E]:
|
|
17
|
+
raise NotImplementedError
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def try_into[T, E](from_: TryInto[T, E], to: type[T]) -> Result[T, E]:
|
|
21
|
+
return from_.__try_into__(to)
|