pythonic-fp-booleans 2.0.0__tar.gz → 2.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.
- {pythonic_fp_booleans-2.0.0 → pythonic_fp_booleans-2.1.0}/CHANGELOG.rst +6 -0
- {pythonic_fp_booleans-2.0.0 → pythonic_fp_booleans-2.1.0}/PKG-INFO +4 -4
- {pythonic_fp_booleans-2.0.0 → pythonic_fp_booleans-2.1.0}/README.rst +2 -2
- {pythonic_fp_booleans-2.0.0 → pythonic_fp_booleans-2.1.0}/pyproject.toml +2 -2
- {pythonic_fp_booleans-2.0.0 → pythonic_fp_booleans-2.1.0}/src/pythonic_fp/booleans/__init__.py +1 -0
- pythonic_fp_booleans-2.1.0/src/pythonic_fp/booleans/flavored.pyi +19 -0
- pythonic_fp_booleans-2.1.0/src/pythonic_fp/booleans/py.typed +0 -0
- {pythonic_fp_booleans-2.0.0 → pythonic_fp_booleans-2.1.0}/src/pythonic_fp/booleans/subtypable.py +4 -4
- pythonic_fp_booleans-2.1.0/src/pythonic_fp/booleans/subtypable.pyi +18 -0
- pythonic_fp_booleans-2.1.0/src/pythonic_fp/booleans/truthy_falsy.pyi +21 -0
- {pythonic_fp_booleans-2.0.0 → pythonic_fp_booleans-2.1.0}/.gitignore +0 -0
- {pythonic_fp_booleans-2.0.0 → pythonic_fp_booleans-2.1.0}/LICENSE +0 -0
- /pythonic_fp_booleans-2.0.0/src/pythonic_fp/booleans/py.typed → /pythonic_fp_booleans-2.1.0/src/pythonic_fp/booleans/__init__.pyi +0 -0
- {pythonic_fp_booleans-2.0.0 → pythonic_fp_booleans-2.1.0}/src/pythonic_fp/booleans/flavored.py +0 -0
- {pythonic_fp_booleans-2.0.0 → pythonic_fp_booleans-2.1.0}/src/pythonic_fp/booleans/truthy_falsy.py +0 -0
- {pythonic_fp_booleans-2.0.0 → pythonic_fp_booleans-2.1.0}/tests/test_bool_vs_fbool.py +0 -0
- {pythonic_fp_booleans-2.0.0 → pythonic_fp_booleans-2.1.0}/tests/test_bool_vs_sbool.py +0 -0
- {pythonic_fp_booleans-2.0.0 → pythonic_fp_booleans-2.1.0}/tests/test_flavored.py +0 -0
- {pythonic_fp_booleans-2.0.0 → pythonic_fp_booleans-2.1.0}/tests/test_flavored_non_shortcut_logic.py +0 -0
- {pythonic_fp_booleans-2.0.0 → pythonic_fp_booleans-2.1.0}/tests/test_flavored_sbool.py +0 -0
- {pythonic_fp_booleans-2.0.0 → pythonic_fp_booleans-2.1.0}/tests/test_subtypable_non_shortcut_logic.py +0 -0
- {pythonic_fp_booleans-2.0.0 → pythonic_fp_booleans-2.1.0}/tests/test_true_false.py +0 -0
- {pythonic_fp_booleans-2.0.0 → pythonic_fp_booleans-2.1.0}/tests/test_true_false_non_shortcut_logic.py +0 -0
- {pythonic_fp_booleans-2.0.0 → pythonic_fp_booleans-2.1.0}/tests/test_typing.py +0 -0
- {pythonic_fp_booleans-2.0.0 → pythonic_fp_booleans-2.1.0}/tests/test_variance.py +0 -0
|
@@ -17,6 +17,12 @@ See `Semantic Versioning 2.0.0 <https://semver.org>`_.
|
|
|
17
17
|
Releases and Important Milestones
|
|
18
18
|
---------------------------------
|
|
19
19
|
|
|
20
|
+
PyPI 2.1.0 - 2025-12-02
|
|
21
|
+
~~~~~~~~~~~~~~~~~~~~~~~
|
|
22
|
+
|
|
23
|
+
Now requires pythonic-fp-gadgets 4.0.1 to be installed.
|
|
24
|
+
|
|
25
|
+
|
|
20
26
|
PyPI 2.0.0 - 2025-09-27
|
|
21
27
|
~~~~~~~~~~~~~~~~~~~~~~~
|
|
22
28
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pythonic-fp-booleans
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.1.0
|
|
4
4
|
Summary: Subtypable Boolean Class Hierarchy
|
|
5
5
|
Keywords: booleans,subtypable
|
|
6
6
|
Author-email: "Geoffrey R. Scheller" <geoffrey@scheller.com>
|
|
@@ -14,7 +14,7 @@ Classifier: Operating System :: OS Independent
|
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.13
|
|
15
15
|
Classifier: Typing :: Typed
|
|
16
16
|
License-File: LICENSE
|
|
17
|
-
Requires-Dist: pythonic-fp-gadgets>=
|
|
17
|
+
Requires-Dist: pythonic-fp-gadgets>=4.0.1
|
|
18
18
|
Requires-Dist: pytest>=8.4.1 ; extra == "test"
|
|
19
19
|
Project-URL: Changelog, https://github.com/grscheller/pythonic-fp-booleans/blob/main/CHANGELOG.rst
|
|
20
20
|
Project-URL: Documentation, https://grscheller.github.io/pythonic-fp/booleans/development/build/html/
|
|
@@ -36,7 +36,7 @@ composed with Python’s bitwise operators.
|
|
|
36
36
|
|
|
37
37
|
Part of the
|
|
38
38
|
`pythonic-fp
|
|
39
|
-
<https://grscheller.github.io/pythonic-fp
|
|
39
|
+
<https://grscheller.github.io/pythonic-fp>`_
|
|
40
40
|
PyPI projects.
|
|
41
41
|
|
|
42
42
|
Documentation
|
|
@@ -44,7 +44,7 @@ Documentation
|
|
|
44
44
|
|
|
45
45
|
Documentation for this project is hosted on
|
|
46
46
|
`GitHub Pages
|
|
47
|
-
<https://grscheller.github.io/pythonic-fp/booleans
|
|
47
|
+
<https://grscheller.github.io/pythonic-fp/booleans>`_.
|
|
48
48
|
|
|
49
49
|
Copyright and License
|
|
50
50
|
---------------------
|
|
@@ -12,7 +12,7 @@ composed with Python’s bitwise operators.
|
|
|
12
12
|
|
|
13
13
|
Part of the
|
|
14
14
|
`pythonic-fp
|
|
15
|
-
<https://grscheller.github.io/pythonic-fp
|
|
15
|
+
<https://grscheller.github.io/pythonic-fp>`_
|
|
16
16
|
PyPI projects.
|
|
17
17
|
|
|
18
18
|
Documentation
|
|
@@ -20,7 +20,7 @@ Documentation
|
|
|
20
20
|
|
|
21
21
|
Documentation for this project is hosted on
|
|
22
22
|
`GitHub Pages
|
|
23
|
-
<https://grscheller.github.io/pythonic-fp/booleans
|
|
23
|
+
<https://grscheller.github.io/pythonic-fp/booleans>`_.
|
|
24
24
|
|
|
25
25
|
Copyright and License
|
|
26
26
|
---------------------
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "pythonic-fp-booleans"
|
|
3
|
-
version = "2.
|
|
3
|
+
version = "2.1.0"
|
|
4
4
|
readme = "README.rst"
|
|
5
5
|
requires-python = ">=3.13"
|
|
6
6
|
license = { file = "LICENSE" }
|
|
@@ -19,7 +19,7 @@ classifiers = [
|
|
|
19
19
|
"Typing :: Typed",
|
|
20
20
|
]
|
|
21
21
|
dependencies = [
|
|
22
|
-
"pythonic-fp-gadgets>=
|
|
22
|
+
"pythonic-fp-gadgets>=4.0.1",
|
|
23
23
|
]
|
|
24
24
|
dynamic = ["description"]
|
|
25
25
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from .subtypable import SBool
|
|
2
|
+
from collections.abc import Hashable
|
|
3
|
+
|
|
4
|
+
__all__ = ['FBool', 'truthy', 'falsy']
|
|
5
|
+
|
|
6
|
+
class FBool(SBool):
|
|
7
|
+
def __new__(cls, witness: object, flavor: Hashable) -> FBool: ...
|
|
8
|
+
def __init__(self, witness: object, flavor: Hashable) -> None: ...
|
|
9
|
+
def __invert__(self) -> FBool: ...
|
|
10
|
+
def __and__(self, other: int) -> SBool: ...
|
|
11
|
+
def __rand__(self, other: int) -> SBool: ...
|
|
12
|
+
def __or__(self, other: int) -> SBool: ...
|
|
13
|
+
def __ror__(self, other: int) -> SBool: ...
|
|
14
|
+
def __xor__(self, other: int) -> SBool: ...
|
|
15
|
+
def __rxor__(self, other: int) -> SBool: ...
|
|
16
|
+
def flavor(self) -> Hashable: ...
|
|
17
|
+
|
|
18
|
+
def truthy(flavor: Hashable) -> FBool: ...
|
|
19
|
+
def falsy(flavor: Hashable) -> FBool: ...
|
|
File without changes
|
{pythonic_fp_booleans-2.0.0 → pythonic_fp_booleans-2.1.0}/src/pythonic_fp/booleans/subtypable.py
RENAMED
|
@@ -56,7 +56,7 @@ operator to return an opposite ``SBool`` class or subclass.
|
|
|
56
56
|
import threading
|
|
57
57
|
from collections.abc import Hashable
|
|
58
58
|
from typing import cast, ClassVar, Final, overload
|
|
59
|
-
from pythonic_fp.gadgets
|
|
59
|
+
from pythonic_fp.gadgets import first_common_ancestor as fca
|
|
60
60
|
from pythonic_fp.gadgets.sentinels.novalue import NoValue
|
|
61
61
|
|
|
62
62
|
__all__ = ['SBool', 'TRUTH', 'LIE']
|
|
@@ -110,7 +110,7 @@ class SBool(int):
|
|
|
110
110
|
|
|
111
111
|
def __and__(self, other: int) -> int:
|
|
112
112
|
try:
|
|
113
|
-
base_class =
|
|
113
|
+
base_class = fca(type(self), type(other))
|
|
114
114
|
except TypeError:
|
|
115
115
|
if type(other) is bool:
|
|
116
116
|
base_class = int
|
|
@@ -127,7 +127,7 @@ class SBool(int):
|
|
|
127
127
|
|
|
128
128
|
def __or__(self, other: int) -> int:
|
|
129
129
|
try:
|
|
130
|
-
base_class =
|
|
130
|
+
base_class = fca(type(self), type(other))
|
|
131
131
|
except TypeError:
|
|
132
132
|
if type(other) is bool:
|
|
133
133
|
base_class = int
|
|
@@ -144,7 +144,7 @@ class SBool(int):
|
|
|
144
144
|
|
|
145
145
|
def __xor__(self, other: int) -> int:
|
|
146
146
|
try:
|
|
147
|
-
base_class =
|
|
147
|
+
base_class = fca(type(self), type(other))
|
|
148
148
|
except TypeError:
|
|
149
149
|
if type(other) is bool:
|
|
150
150
|
base_class = int
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from collections.abc import Hashable
|
|
2
|
+
from typing import Final, overload
|
|
3
|
+
|
|
4
|
+
__all__ = ['SBool', 'TRUTH', 'LIE']
|
|
5
|
+
|
|
6
|
+
class SBool(int):
|
|
7
|
+
@overload
|
|
8
|
+
def __new__(cls) -> SBool: ...
|
|
9
|
+
@overload
|
|
10
|
+
def __new__(cls, witness: object) -> SBool: ...
|
|
11
|
+
def __init__(self, witness: object = False, flavor: Hashable = ...) -> None: ...
|
|
12
|
+
def __invert__(self) -> SBool: ...
|
|
13
|
+
def __and__(self, other: int) -> int: ...
|
|
14
|
+
def __or__(self, other: int) -> int: ...
|
|
15
|
+
def __xor__(self, other: int) -> int: ...
|
|
16
|
+
|
|
17
|
+
TRUTH: Final[SBool]
|
|
18
|
+
LIE: Final[SBool]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from .subtypable import SBool
|
|
2
|
+
from collections.abc import Hashable
|
|
3
|
+
from typing import Final
|
|
4
|
+
|
|
5
|
+
__all__ = ['TF_Bool', 'T_Bool', 'F_Bool', 'ALWAYS', 'NEVER', 'TF_Boolean']
|
|
6
|
+
|
|
7
|
+
class TF_Bool(SBool):
|
|
8
|
+
def __new__(cls, witness: object, flavor: Hashable = ...) -> TF_Bool: ...
|
|
9
|
+
def __invert__(self) -> TF_Bool: ...
|
|
10
|
+
def __and__(self, other: int) -> SBool: ...
|
|
11
|
+
def __or__(self, other: int) -> SBool: ...
|
|
12
|
+
def __xor__(self, other: int) -> SBool: ...
|
|
13
|
+
|
|
14
|
+
class T_Bool(TF_Bool):
|
|
15
|
+
def __new__(cls, witness: object = ..., flavor: Hashable = ...) -> T_Bool: ...
|
|
16
|
+
|
|
17
|
+
class F_Bool(TF_Bool):
|
|
18
|
+
def __new__(cls, witness: object = ..., flavor: Hashable = ...) -> F_Bool: ...
|
|
19
|
+
TF_Boolean = T_Bool | F_Bool | TF_Bool
|
|
20
|
+
ALWAYS: Final[TF_Boolean]
|
|
21
|
+
NEVER: Final[TF_Boolean]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pythonic_fp_booleans-2.0.0 → pythonic_fp_booleans-2.1.0}/src/pythonic_fp/booleans/flavored.py
RENAMED
|
File without changes
|
{pythonic_fp_booleans-2.0.0 → pythonic_fp_booleans-2.1.0}/src/pythonic_fp/booleans/truthy_falsy.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pythonic_fp_booleans-2.0.0 → pythonic_fp_booleans-2.1.0}/tests/test_flavored_non_shortcut_logic.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|