v440 2.0.0.dev78__tar.gz → 2.0.0.dev79__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.
- {v440-2.0.0.dev78/src/v440.egg-info → v440-2.0.0.dev79}/PKG-INFO +1 -1
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/pyproject.toml +1 -1
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/_utils/releaseparse/numerals.py +7 -13
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/core/Release.py +3 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79/src/v440.egg-info}/PKG-INFO +1 -1
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/LICENSE.txt +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/MANIFEST.in +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/README.rst +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/setup.cfg +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/__init__.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/_utils/BaseStringer.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/_utils/Cfg.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/_utils/Digest.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/_utils/ListStringer.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/_utils/Pattern.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/_utils/SlotStringer.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/_utils/__init__.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/_utils/cfg.toml +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/_utils/guarding.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/_utils/qualparse.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/_utils/releaseparse/__init__.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/_utils/releaseparse/listing.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/_utils/releaseparse/ranging.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/_utils/segmenting.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/core/Base.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/core/Local.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/core/Public.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/core/Qual.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/core/Version.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/core/VersionError.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/core/__init__.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/tests/__init__.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/tests/test_testdata.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/tests/test_version.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440/tests/testdata.toml +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440.egg-info/SOURCES.txt +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440.egg-info/dependency_links.txt +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440.egg-info/requires.txt +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev79}/src/v440.egg-info/top_level.txt +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import operator
|
|
3
4
|
from typing import *
|
|
4
5
|
|
|
5
6
|
from v440.core.VersionError import VersionError
|
|
@@ -10,20 +11,13 @@ __all__ = ["numeral"]
|
|
|
10
11
|
def numeral(value: Any, /) -> int:
|
|
11
12
|
v: int
|
|
12
13
|
try:
|
|
13
|
-
|
|
14
|
+
if isinstance(value, int):
|
|
15
|
+
v = operator.index(value)
|
|
16
|
+
else:
|
|
17
|
+
v = int(str(value))
|
|
18
|
+
if v < 0:
|
|
19
|
+
raise ValueError
|
|
14
20
|
except Exception:
|
|
15
21
|
e: str = "%r is not a valid numeral segment"
|
|
16
22
|
raise VersionError(e % value) from None
|
|
17
23
|
return v
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def numeral_(value: Any, /) -> int:
|
|
21
|
-
if isinstance(value, int):
|
|
22
|
-
return int(value)
|
|
23
|
-
s: str = str(value)
|
|
24
|
-
if s == "":
|
|
25
|
-
return 0
|
|
26
|
-
i: int = int(s)
|
|
27
|
-
if i < 0:
|
|
28
|
-
raise ValueError
|
|
29
|
-
return i
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|