raisefunction 1.0.1__tar.gz → 1.0.3__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.
- {raisefunction-1.0.1/src/raisefunction.egg-info → raisefunction-1.0.3}/PKG-INFO +6 -5
- {raisefunction-1.0.1 → raisefunction-1.0.3}/pyproject.toml +4 -4
- {raisefunction-1.0.1 → raisefunction-1.0.3}/src/raisefunction/core/__init__.py +10 -12
- {raisefunction-1.0.1 → raisefunction-1.0.3}/src/raisefunction/tests/test_0.py +2 -2
- {raisefunction-1.0.1 → raisefunction-1.0.3/src/raisefunction.egg-info}/PKG-INFO +6 -5
- raisefunction-1.0.3/src/raisefunction.egg-info/requires.txt +1 -0
- raisefunction-1.0.1/src/raisefunction.egg-info/requires.txt +0 -1
- {raisefunction-1.0.1 → raisefunction-1.0.3}/LICENSE.txt +0 -0
- {raisefunction-1.0.1 → raisefunction-1.0.3}/MANIFEST.in +0 -0
- {raisefunction-1.0.1 → raisefunction-1.0.3}/README.rst +0 -0
- {raisefunction-1.0.1 → raisefunction-1.0.3}/setup.cfg +0 -0
- {raisefunction-1.0.1 → raisefunction-1.0.3}/src/raisefunction/__init__.py +0 -0
- {raisefunction-1.0.1 → raisefunction-1.0.3}/src/raisefunction/tests/__init__.py +0 -0
- {raisefunction-1.0.1 → raisefunction-1.0.3}/src/raisefunction/tests/test_1.py +0 -0
- {raisefunction-1.0.1 → raisefunction-1.0.3}/src/raisefunction.egg-info/SOURCES.txt +0 -0
- {raisefunction-1.0.1 → raisefunction-1.0.3}/src/raisefunction.egg-info/dependency_links.txt +0 -0
- {raisefunction-1.0.1 → raisefunction-1.0.3}/src/raisefunction.egg-info/top_level.txt +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: raisefunction
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.3
|
|
4
4
|
Summary: This project provides a function that raises errors passed to it.
|
|
5
|
-
Author-email: Johannes <johannes
|
|
5
|
+
Author-email: Johannes <johannes.programming@gmail.com>
|
|
6
6
|
License: The MIT License (MIT)
|
|
7
7
|
|
|
8
8
|
Copyright (c) 2025 Johannes
|
|
@@ -37,10 +37,11 @@ Classifier: Programming Language :: Python
|
|
|
37
37
|
Classifier: Programming Language :: Python :: 3
|
|
38
38
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
39
39
|
Classifier: Typing :: Typed
|
|
40
|
-
Requires-Python: >=3.
|
|
40
|
+
Requires-Python: >=3.11
|
|
41
41
|
Description-Content-Type: text/x-rst
|
|
42
42
|
License-File: LICENSE.txt
|
|
43
|
-
Requires-Dist: overloadable
|
|
43
|
+
Requires-Dist: overloadable<2,>=1.0.14
|
|
44
|
+
Dynamic: license-file
|
|
44
45
|
|
|
45
46
|
=============
|
|
46
47
|
raisefunction
|
|
@@ -6,7 +6,7 @@ requires = [
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
authors = [
|
|
9
|
-
{ email = "johannes
|
|
9
|
+
{ email = "johannes.programming@gmail.com", name = "Johannes" },
|
|
10
10
|
]
|
|
11
11
|
classifiers = [
|
|
12
12
|
"Development Status :: 5 - Production/Stable",
|
|
@@ -20,14 +20,14 @@ classifiers = [
|
|
|
20
20
|
"Typing :: Typed",
|
|
21
21
|
]
|
|
22
22
|
dependencies = [
|
|
23
|
-
"overloadable>=1.0.
|
|
23
|
+
"overloadable>=1.0.14,<2",
|
|
24
24
|
]
|
|
25
25
|
description = "This project provides a function that raises errors passed to it."
|
|
26
26
|
keywords = []
|
|
27
27
|
name = "raisefunction"
|
|
28
28
|
readme = "README.rst"
|
|
29
|
-
requires-python = ">=3.
|
|
30
|
-
version = "1.0.
|
|
29
|
+
requires-python = ">=3.11"
|
|
30
|
+
version = "1.0.3"
|
|
31
31
|
|
|
32
32
|
[project.license]
|
|
33
33
|
file = "LICENSE.txt"
|
|
@@ -6,26 +6,24 @@ __all__ = ["raisefunction"]
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
@overloadable
|
|
9
|
-
def raisefunction(*args: Any) -> int:
|
|
9
|
+
def raisefunction(*args: Any, **kwargs: Any) -> int:
|
|
10
10
|
"This function works as dispatcher."
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
if
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
)
|
|
19
|
-
return len(args)
|
|
11
|
+
argc: int = len(args)
|
|
12
|
+
keys: set = set(kwargs.keys())
|
|
13
|
+
if argc <= 1 and keys == set():
|
|
14
|
+
return 1
|
|
15
|
+
if argc == 0 and keys == {"exc"}:
|
|
16
|
+
return 1
|
|
17
|
+
return 2
|
|
20
18
|
|
|
21
19
|
|
|
22
20
|
@raisefunction.overload(1)
|
|
23
|
-
def raisefunction(exc: BaseException
|
|
21
|
+
def raisefunction(exc: BaseException) -> None:
|
|
24
22
|
"This function raises the given exception."
|
|
25
23
|
raise exc
|
|
26
24
|
|
|
27
25
|
|
|
28
26
|
@raisefunction.overload(2)
|
|
29
|
-
def raisefunction(exc: BaseException, cause: Optional[BaseException]
|
|
27
|
+
def raisefunction(exc: BaseException, cause: Optional[BaseException]) -> None:
|
|
30
28
|
"This function raises the given exception with the given cause."
|
|
31
29
|
raise exc from cause
|
|
@@ -8,13 +8,13 @@ class TestRaiseFunction(unittest.TestCase):
|
|
|
8
8
|
"""Test the dispatcher raises a TypeError with no arguments."""
|
|
9
9
|
with self.assertRaises(TypeError) as context:
|
|
10
10
|
raisefunction()
|
|
11
|
-
self.assertIn("requires at least 1 positional argument", str(context.exception))
|
|
11
|
+
# self.assertIn("requires at least 1 positional argument", str(context.exception))
|
|
12
12
|
|
|
13
13
|
def test_dispatcher_too_many_arguments(self):
|
|
14
14
|
"""Test the dispatcher raises a TypeError with more than 2 arguments."""
|
|
15
15
|
with self.assertRaises(TypeError) as context:
|
|
16
16
|
raisefunction(1, 2, 3)
|
|
17
|
-
self.assertIn("takes at most 2 positional arguments", str(context.exception))
|
|
17
|
+
# self.assertIn("takes at most 2 positional arguments", str(context.exception))
|
|
18
18
|
|
|
19
19
|
def test_raise_single_exception(self):
|
|
20
20
|
"""Test the single exception raising overload."""
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: raisefunction
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.3
|
|
4
4
|
Summary: This project provides a function that raises errors passed to it.
|
|
5
|
-
Author-email: Johannes <johannes
|
|
5
|
+
Author-email: Johannes <johannes.programming@gmail.com>
|
|
6
6
|
License: The MIT License (MIT)
|
|
7
7
|
|
|
8
8
|
Copyright (c) 2025 Johannes
|
|
@@ -37,10 +37,11 @@ Classifier: Programming Language :: Python
|
|
|
37
37
|
Classifier: Programming Language :: Python :: 3
|
|
38
38
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
39
39
|
Classifier: Typing :: Typed
|
|
40
|
-
Requires-Python: >=3.
|
|
40
|
+
Requires-Python: >=3.11
|
|
41
41
|
Description-Content-Type: text/x-rst
|
|
42
42
|
License-File: LICENSE.txt
|
|
43
|
-
Requires-Dist: overloadable
|
|
43
|
+
Requires-Dist: overloadable<2,>=1.0.14
|
|
44
|
+
Dynamic: license-file
|
|
44
45
|
|
|
45
46
|
=============
|
|
46
47
|
raisefunction
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
overloadable<2,>=1.0.14
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
overloadable>=1.0.9
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|