v440 2.0.0.dev145__tar.gz → 2.0.0.dev146__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.
Files changed (40) hide show
  1. {v440-2.0.0.dev145/src/v440.egg-info → v440-2.0.0.dev146}/PKG-INFO +1 -1
  2. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/pyproject.toml +1 -1
  3. v440-2.0.0.dev146/src/v440/_utils/releaseparse/ranging.py +49 -0
  4. {v440-2.0.0.dev145 → v440-2.0.0.dev146/src/v440.egg-info}/PKG-INFO +1 -1
  5. v440-2.0.0.dev145/src/v440/_utils/releaseparse/ranging.py +0 -37
  6. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/LICENSE.txt +0 -0
  7. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/MANIFEST.in +0 -0
  8. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/README.rst +0 -0
  9. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/setup.cfg +0 -0
  10. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/__init__.py +0 -0
  11. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/_utils/BaseStringer.py +0 -0
  12. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/_utils/Cfg.py +0 -0
  13. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/_utils/ListStringer.py +0 -0
  14. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/_utils/Pattern.py +0 -0
  15. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/_utils/SlotStringer.py +0 -0
  16. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/_utils/__init__.py +0 -0
  17. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/_utils/cfg.toml +0 -0
  18. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/_utils/guarding.py +0 -0
  19. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/_utils/releaseparse/__init__.py +0 -0
  20. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/_utils/releaseparse/deleting.py +0 -0
  21. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/_utils/releaseparse/getting.py +0 -0
  22. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/_utils/releaseparse/listing.py +0 -0
  23. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/_utils/releaseparse/numerals.py +0 -0
  24. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/_utils/releaseparse/setting.py +0 -0
  25. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/core/Base.py +0 -0
  26. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/core/Local.py +0 -0
  27. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/core/Public.py +0 -0
  28. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/core/Qual.py +0 -0
  29. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/core/Release.py +0 -0
  30. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/core/Version.py +0 -0
  31. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/core/VersionError.py +0 -0
  32. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/core/__init__.py +0 -0
  33. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/tests/__init__.py +0 -0
  34. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/tests/test_testdata.py +0 -0
  35. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/tests/test_version.py +0 -0
  36. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440/tests/testdata.toml +0 -0
  37. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440.egg-info/SOURCES.txt +0 -0
  38. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440.egg-info/dependency_links.txt +0 -0
  39. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440.egg-info/requires.txt +0 -0
  40. {v440-2.0.0.dev145 → v440-2.0.0.dev146}/src/v440.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: v440
3
- Version: 2.0.0.dev145
3
+ Version: 2.0.0.dev146
4
4
  Summary: This project provides mutable version objects in accordance with PEP440.
5
5
  Author-email: Johannes <johannes.programming@gmail.com>
6
6
  License: The MIT License (MIT)
@@ -36,7 +36,7 @@ keywords = []
36
36
  name = "v440"
37
37
  readme = "README.rst"
38
38
  requires-python = ">=3.11"
39
- version = "2.0.0.dev145"
39
+ version = "2.0.0.dev146"
40
40
 
41
41
  [project.license]
42
42
  file = "LICENSE.txt"
@@ -0,0 +1,49 @@
1
+ from __future__ import annotations
2
+
3
+ import operator
4
+ from typing import *
5
+
6
+ __all__ = ["torange"]
7
+
8
+
9
+ def torange(key: Any, length: int) -> range:
10
+ step: Any = calcstep(key.step)
11
+ start: int = calcstart(key.start, length=length, fwd=step > 0)
12
+ stop: int = calcstop(key.stop, length=length, fwd=step > 0)
13
+ ans: range = range(start, stop, step)
14
+ return ans
15
+
16
+
17
+ def calcstep(value: Optional[SupportsIndex]) -> int:
18
+ if value is None:
19
+ return 1
20
+ ans: int = operator.index(value)
21
+ if ans == 0:
22
+ raise ValueError
23
+ return ans
24
+
25
+
26
+ def calcstart(value: Optional[SupportsIndex], *, length: int, fwd: bool) -> int:
27
+ ans: int
28
+ if value is None:
29
+ ans = 0 if fwd else (length - 1)
30
+ else:
31
+ ans = operator.index(value)
32
+ if ans < 0:
33
+ ans += length
34
+ if ans < 0:
35
+ ans = 0 if fwd else -1
36
+ return ans
37
+
38
+
39
+ def calcstop(value: Optional[SupportsIndex], *, length: int, fwd: bool) -> int:
40
+ ans: int
41
+ if value is None:
42
+ ans = length if fwd else -1
43
+ else:
44
+ ans = operator.index(value)
45
+ if ans < 0:
46
+ ans += length
47
+ if ans < 0:
48
+ ans = 0 if fwd else -1
49
+ return ans
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: v440
3
- Version: 2.0.0.dev145
3
+ Version: 2.0.0.dev146
4
4
  Summary: This project provides mutable version objects in accordance with PEP440.
5
5
  Author-email: Johannes <johannes.programming@gmail.com>
6
6
  License: The MIT License (MIT)
@@ -1,37 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import operator
4
- from typing import *
5
-
6
- __all__ = ["torange"]
7
-
8
-
9
- def torange(key: Any, length: Any) -> range:
10
- start: Any = key.start
11
- stop: Any = key.stop
12
- step: Any = key.step
13
- if step is None:
14
- step = 1
15
- else:
16
- step = operator.index(step)
17
- if step == 0:
18
- raise ValueError
19
- fwd: bool = step > 0
20
- if start is None:
21
- start = 0 if fwd else (length - 1)
22
- else:
23
- start = operator.index(start)
24
- if stop is None:
25
- stop = length if fwd else -1
26
- else:
27
- stop = operator.index(stop)
28
- if start < 0:
29
- start += length
30
- if start < 0:
31
- start = 0 if fwd else -1
32
- if stop < 0:
33
- stop += length
34
- if stop < 0:
35
- stop = 0 if fwd else -1
36
- ans: range = range(start, stop, step)
37
- return ans
File without changes
File without changes
File without changes
File without changes