egglog 7.0.0__tar.gz → 7.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.
Potentially problematic release.
This version of egglog might be problematic. Click here for more details.
- egglog-7.1.0/.github/dependabot.yml +19 -0
- {egglog-7.0.0 → egglog-7.1.0}/.github/workflows/CI.yml +7 -7
- {egglog-7.0.0 → egglog-7.1.0}/.github/workflows/version.yml +13 -12
- {egglog-7.0.0 → egglog-7.1.0}/Cargo.lock +44 -38
- {egglog-7.0.0 → egglog-7.1.0}/Cargo.toml +5 -5
- {egglog-7.0.0 → egglog-7.1.0}/PKG-INFO +15 -15
- egglog-7.1.0/README.md +10 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/changelog.md +16 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/reference/python-integration.md +38 -0
- {egglog-7.0.0 → egglog-7.1.0}/pyproject.toml +2 -3
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/bindings.pyi +7 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/builtins.py +41 -1
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/conversion.py +22 -17
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/declarations.py +57 -31
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/egraph.py +93 -18
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/egraph_state.py +76 -37
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/exp/array_api.py +8 -8
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/pretty.py +56 -10
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/runtime.py +112 -30
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/thunk.py +1 -2
- {egglog-7.0.0 → egglog-7.1.0}/python/tests/test_high_level.py +19 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/tests/test_runtime.py +11 -10
- egglog-7.1.0/python/tests/test_unstable_fn.py +184 -0
- {egglog-7.0.0 → egglog-7.1.0}/src/conversions.rs +10 -1
- {egglog-7.0.0 → egglog-7.1.0}/src/egraph.rs +3 -1
- {egglog-7.0.0 → egglog-7.1.0}/src/py_object_sort.rs +9 -9
- egglog-7.0.0/README.md +0 -10
- {egglog-7.0.0 → egglog-7.1.0}/.gitignore +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/.pre-commit-config.yaml +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/.readthedocs.yaml +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/CITATION.cff +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/LICENSE +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/conftest.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/.gitignore +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/_templates/comments.html +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/conf.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/environment.yml +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/explanation/.gitignore +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/explanation/2023_07_presentation.ipynb +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/explanation/2023_11_09_portland_state.ipynb +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/explanation/2023_11_17_pytensor.ipynb +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/explanation/2023_11_pydata_lightning_talk.ipynb +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/explanation/2023_12_02_congruence_closure-1.png +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/explanation/2023_12_02_congruence_closure-2.png +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/explanation/2023_12_02_congruence_closure.md +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/explanation/2024_03_17_community_talk.ipynb +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/explanation/2024_03_17_map.svg +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/explanation/big_graph.svg +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/explanation/define_and_define.md +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/explanation/ecosystem-graph.png +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/explanation/egg.png +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/explanation/indexing_pushdown.ipynb +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/explanation/moa.png +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/explanation/optional_values.md +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/explanation/pldi_2023_presentation.ipynb +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/explanation.md +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/how-to-guides.md +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/index.md +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/reference/bindings.md +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/reference/contributing.md +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/reference/egglog-translation.md +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/reference/high-level.md +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/reference/usage.md +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/reference.md +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/tutorials/getting-started.ipynb +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/tutorials/screenshot-1.png +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/tutorials/screenshot-2.png +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/tutorials/sklearn.ipynb +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/docs/tutorials.md +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/increment_version.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/__init__.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/config.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/examples/README.rst +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/examples/__init__.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/examples/bool.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/examples/eqsat_basic.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/examples/fib.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/examples/lambda_.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/examples/matrix.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/examples/ndarrays.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/examples/resolution.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/examples/schedule_demo.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/exp/__init__.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/exp/array_api_jit.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/exp/array_api_numba.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/exp/array_api_program_gen.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/exp/program_gen.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/exp/siu_examples.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/graphviz_widget.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/ipython_magic.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/py.typed +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/type_constraint_solver.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/widget.css +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/egglog/widget.js +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/tests/__init__.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/tests/__snapshots__/test_array_api/TestLDA.test_optimize.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/tests/__snapshots__/test_array_api/TestLDA.test_source_optimized.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/tests/__snapshots__/test_array_api/TestLDA.test_trace.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/tests/__snapshots__/test_program_gen/test_to_string.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/tests/conftest.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/tests/test_array_api.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/tests/test_bindings.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/tests/test_convert.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/tests/test_modules.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/tests/test_pretty.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/tests/test_program_gen.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/tests/test_py_object_sort.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/tests/test_type_constraint_solver.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/python/tests/test_typing.py +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/rust-toolchain.toml +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/src/error.rs +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/src/lib.rs +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/src/serialize.rs +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/src/utils.rs +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/stubtest_allow +0 -0
- {egglog-7.0.0 → egglog-7.1.0}/test-data/unit/check-high-level.test +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
|
3
|
+
# Please see the documentation for all configuration options:
|
|
4
|
+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
|
5
|
+
|
|
6
|
+
version: 2
|
|
7
|
+
updates:
|
|
8
|
+
- package-ecosystem: "cargo"
|
|
9
|
+
directory: "/"
|
|
10
|
+
schedule:
|
|
11
|
+
interval: "weekly"
|
|
12
|
+
- package-ecosystem: "github-actions"
|
|
13
|
+
directory: "/"
|
|
14
|
+
schedule:
|
|
15
|
+
interval: "weekly"
|
|
16
|
+
- package-ecosystem: "pip"
|
|
17
|
+
directory: "/"
|
|
18
|
+
schedule:
|
|
19
|
+
interval: "weekly"
|
|
@@ -28,7 +28,7 @@ jobs:
|
|
|
28
28
|
- uses: dtolnay/rust-toolchain@1.71.1
|
|
29
29
|
- uses: Swatinem/rust-cache@v2
|
|
30
30
|
- name: Setup python ${{ matrix.py }}
|
|
31
|
-
uses: actions/setup-python@
|
|
31
|
+
uses: actions/setup-python@v5
|
|
32
32
|
with:
|
|
33
33
|
python-version: ${{ matrix.py }}
|
|
34
34
|
cache: "pip"
|
|
@@ -40,20 +40,20 @@ jobs:
|
|
|
40
40
|
- uses: actions/checkout@v4
|
|
41
41
|
- uses: dtolnay/rust-toolchain@1.71.1
|
|
42
42
|
- uses: Swatinem/rust-cache@v2
|
|
43
|
-
- uses: actions/setup-python@
|
|
43
|
+
- uses: actions/setup-python@v5
|
|
44
44
|
with:
|
|
45
45
|
python-version: "3.10"
|
|
46
46
|
cache: "pip"
|
|
47
47
|
- run: pip install -e .[test] mypy pre-commit
|
|
48
|
-
- run: pre-commit run --hook-stage manual mypy
|
|
49
|
-
- run: pre-commit run --hook-stage manual stubtest
|
|
48
|
+
- run: pre-commit run --hook-stage manual --all-files mypy
|
|
49
|
+
- run: pre-commit run --hook-stage manual --all-files stubtest
|
|
50
50
|
benchmark:
|
|
51
51
|
runs-on: ubuntu-latest
|
|
52
52
|
steps:
|
|
53
53
|
- uses: actions/checkout@v4
|
|
54
54
|
- uses: dtolnay/rust-toolchain@1.71.1
|
|
55
55
|
- uses: Swatinem/rust-cache@v2
|
|
56
|
-
- uses: actions/setup-python@
|
|
56
|
+
- uses: actions/setup-python@v5
|
|
57
57
|
with:
|
|
58
58
|
python-version: "3.12"
|
|
59
59
|
cache: "pip"
|
|
@@ -68,7 +68,7 @@ jobs:
|
|
|
68
68
|
- uses: actions/checkout@v4
|
|
69
69
|
- uses: dtolnay/rust-toolchain@1.71.1
|
|
70
70
|
- uses: Swatinem/rust-cache@v2
|
|
71
|
-
- uses: actions/setup-python@
|
|
71
|
+
- uses: actions/setup-python@v5
|
|
72
72
|
with:
|
|
73
73
|
python-version: "3.10"
|
|
74
74
|
cache: "pip"
|
|
@@ -77,4 +77,4 @@ jobs:
|
|
|
77
77
|
sudo apt-get update
|
|
78
78
|
sudo apt-get install -y graphviz
|
|
79
79
|
- run: pip install -e .[docs] pre-commit
|
|
80
|
-
- run: pre-commit run --hook-stage manual docs
|
|
80
|
+
- run: pre-commit run --hook-stage manual --all-files docs
|
|
@@ -53,15 +53,15 @@ jobs:
|
|
|
53
53
|
- uses: actions/checkout@v4
|
|
54
54
|
with:
|
|
55
55
|
ref: version-${{ needs.bump.outputs.version }}
|
|
56
|
-
- uses: PyO3/maturin-action@v1.
|
|
56
|
+
- uses: PyO3/maturin-action@v1.42.1
|
|
57
57
|
with:
|
|
58
58
|
manylinux: auto
|
|
59
59
|
command: build
|
|
60
60
|
args: --release --sdist -o dist --find-interpreter
|
|
61
61
|
- name: Upload wheels
|
|
62
|
-
uses: actions/upload-artifact@
|
|
62
|
+
uses: actions/upload-artifact@v4
|
|
63
63
|
with:
|
|
64
|
-
name: wheels
|
|
64
|
+
name: wheels-linux
|
|
65
65
|
path: dist
|
|
66
66
|
|
|
67
67
|
windows:
|
|
@@ -72,14 +72,14 @@ jobs:
|
|
|
72
72
|
- uses: actions/checkout@v4
|
|
73
73
|
with:
|
|
74
74
|
ref: version-${{ needs.bump.outputs.version }}
|
|
75
|
-
- uses: PyO3/maturin-action@v1.
|
|
75
|
+
- uses: PyO3/maturin-action@v1.42.1
|
|
76
76
|
with:
|
|
77
77
|
command: build
|
|
78
78
|
args: --release -o dist --find-interpreter
|
|
79
79
|
- name: Upload wheels
|
|
80
|
-
uses: actions/upload-artifact@
|
|
80
|
+
uses: actions/upload-artifact@v4
|
|
81
81
|
with:
|
|
82
|
-
name: wheels
|
|
82
|
+
name: wheels-windows
|
|
83
83
|
path: dist
|
|
84
84
|
|
|
85
85
|
macos:
|
|
@@ -90,14 +90,14 @@ jobs:
|
|
|
90
90
|
- uses: actions/checkout@v4
|
|
91
91
|
with:
|
|
92
92
|
ref: version-${{ needs.bump.outputs.version }}
|
|
93
|
-
- uses: PyO3/maturin-action@v1.
|
|
93
|
+
- uses: PyO3/maturin-action@v1.42.1
|
|
94
94
|
with:
|
|
95
95
|
command: build
|
|
96
96
|
args: --release -o dist --universal2 --find-interpreter
|
|
97
97
|
- name: Upload wheels
|
|
98
|
-
uses: actions/upload-artifact@
|
|
98
|
+
uses: actions/upload-artifact@v4
|
|
99
99
|
with:
|
|
100
|
-
name: wheels
|
|
100
|
+
name: wheels-macos
|
|
101
101
|
path: dist
|
|
102
102
|
|
|
103
103
|
release:
|
|
@@ -106,11 +106,12 @@ jobs:
|
|
|
106
106
|
if: startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch')
|
|
107
107
|
needs: [macos, windows, linux]
|
|
108
108
|
steps:
|
|
109
|
-
- uses: actions/download-artifact@
|
|
109
|
+
- uses: actions/download-artifact@v4
|
|
110
110
|
with:
|
|
111
|
-
|
|
111
|
+
pattern: wheels-*
|
|
112
|
+
merge-multiple: true
|
|
112
113
|
- name: Publish to PyPI
|
|
113
|
-
uses: PyO3/maturin-action@v1.
|
|
114
|
+
uses: PyO3/maturin-action@v1.42.1
|
|
114
115
|
env:
|
|
115
116
|
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
|
|
116
117
|
with:
|
|
@@ -190,7 +190,7 @@ dependencies = [
|
|
|
190
190
|
"heck",
|
|
191
191
|
"proc-macro2",
|
|
192
192
|
"quote",
|
|
193
|
-
"syn 2.0.
|
|
193
|
+
"syn 2.0.60",
|
|
194
194
|
]
|
|
195
195
|
|
|
196
196
|
[[package]]
|
|
@@ -285,7 +285,7 @@ checksum = "675e35c02a51bb4d4618cb4885b3839ce6d1787c97b664474d9208d074742e20"
|
|
|
285
285
|
[[package]]
|
|
286
286
|
name = "egglog"
|
|
287
287
|
version = "0.1.0"
|
|
288
|
-
source = "git+https://github.com/egraphs-good/egglog?rev=
|
|
288
|
+
source = "git+https://github.com/egraphs-good/egglog?rev=fb4a9f114f9bb93154d6eff0dbab079b5cb4ebb6#fb4a9f114f9bb93154d6eff0dbab079b5cb4ebb6"
|
|
289
289
|
dependencies = [
|
|
290
290
|
"clap",
|
|
291
291
|
"egraph-serialize",
|
|
@@ -312,7 +312,7 @@ dependencies = [
|
|
|
312
312
|
|
|
313
313
|
[[package]]
|
|
314
314
|
name = "egglog-python"
|
|
315
|
-
version = "7.
|
|
315
|
+
version = "7.1.0"
|
|
316
316
|
dependencies = [
|
|
317
317
|
"egglog",
|
|
318
318
|
"egraph-serialize",
|
|
@@ -487,9 +487,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
|
|
|
487
487
|
|
|
488
488
|
[[package]]
|
|
489
489
|
name = "indexmap"
|
|
490
|
-
version = "2.
|
|
490
|
+
version = "2.2.6"
|
|
491
491
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
492
|
-
checksum = "
|
|
492
|
+
checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26"
|
|
493
493
|
dependencies = [
|
|
494
494
|
"equivalent",
|
|
495
495
|
"hashbrown 0.14.1",
|
|
@@ -575,7 +575,7 @@ dependencies = [
|
|
|
575
575
|
"petgraph",
|
|
576
576
|
"pico-args",
|
|
577
577
|
"regex",
|
|
578
|
-
"regex-syntax",
|
|
578
|
+
"regex-syntax 0.7.4",
|
|
579
579
|
"string_cache",
|
|
580
580
|
"term",
|
|
581
581
|
"tiny-keccak",
|
|
@@ -584,11 +584,11 @@ dependencies = [
|
|
|
584
584
|
|
|
585
585
|
[[package]]
|
|
586
586
|
name = "lalrpop-util"
|
|
587
|
-
version = "0.20.
|
|
587
|
+
version = "0.20.2"
|
|
588
588
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
589
|
-
checksum = "
|
|
589
|
+
checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553"
|
|
590
590
|
dependencies = [
|
|
591
|
-
"regex",
|
|
591
|
+
"regex-automata",
|
|
592
592
|
]
|
|
593
593
|
|
|
594
594
|
[[package]]
|
|
@@ -621,15 +621,15 @@ dependencies = [
|
|
|
621
621
|
|
|
622
622
|
[[package]]
|
|
623
623
|
name = "log"
|
|
624
|
-
version = "0.4.
|
|
624
|
+
version = "0.4.21"
|
|
625
625
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
626
|
-
checksum = "
|
|
626
|
+
checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
|
|
627
627
|
|
|
628
628
|
[[package]]
|
|
629
629
|
name = "memchr"
|
|
630
|
-
version = "2.
|
|
630
|
+
version = "2.7.2"
|
|
631
631
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
632
|
-
checksum = "
|
|
632
|
+
checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d"
|
|
633
633
|
|
|
634
634
|
[[package]]
|
|
635
635
|
name = "memoffset"
|
|
@@ -759,7 +759,7 @@ dependencies = [
|
|
|
759
759
|
"pest_meta",
|
|
760
760
|
"proc-macro2",
|
|
761
761
|
"quote",
|
|
762
|
-
"syn 2.0.
|
|
762
|
+
"syn 2.0.60",
|
|
763
763
|
]
|
|
764
764
|
|
|
765
765
|
[[package]]
|
|
@@ -818,9 +818,9 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
|
|
|
818
818
|
|
|
819
819
|
[[package]]
|
|
820
820
|
name = "proc-macro2"
|
|
821
|
-
version = "1.0.
|
|
821
|
+
version = "1.0.81"
|
|
822
822
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
823
|
-
checksum = "
|
|
823
|
+
checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba"
|
|
824
824
|
dependencies = [
|
|
825
825
|
"unicode-ident",
|
|
826
826
|
]
|
|
@@ -883,7 +883,7 @@ dependencies = [
|
|
|
883
883
|
"proc-macro2",
|
|
884
884
|
"pyo3-macros-backend",
|
|
885
885
|
"quote",
|
|
886
|
-
"syn 2.0.
|
|
886
|
+
"syn 2.0.60",
|
|
887
887
|
]
|
|
888
888
|
|
|
889
889
|
[[package]]
|
|
@@ -896,14 +896,14 @@ dependencies = [
|
|
|
896
896
|
"proc-macro2",
|
|
897
897
|
"pyo3-build-config",
|
|
898
898
|
"quote",
|
|
899
|
-
"syn 2.0.
|
|
899
|
+
"syn 2.0.60",
|
|
900
900
|
]
|
|
901
901
|
|
|
902
902
|
[[package]]
|
|
903
903
|
name = "quote"
|
|
904
|
-
version = "1.0.
|
|
904
|
+
version = "1.0.36"
|
|
905
905
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
906
|
-
checksum = "
|
|
906
|
+
checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
|
|
907
907
|
dependencies = [
|
|
908
908
|
"proc-macro2",
|
|
909
909
|
]
|
|
@@ -971,25 +971,25 @@ dependencies = [
|
|
|
971
971
|
|
|
972
972
|
[[package]]
|
|
973
973
|
name = "regex"
|
|
974
|
-
version = "1.
|
|
974
|
+
version = "1.10.4"
|
|
975
975
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
976
|
-
checksum = "
|
|
976
|
+
checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c"
|
|
977
977
|
dependencies = [
|
|
978
978
|
"aho-corasick",
|
|
979
979
|
"memchr",
|
|
980
980
|
"regex-automata",
|
|
981
|
-
"regex-syntax",
|
|
981
|
+
"regex-syntax 0.8.3",
|
|
982
982
|
]
|
|
983
983
|
|
|
984
984
|
[[package]]
|
|
985
985
|
name = "regex-automata"
|
|
986
|
-
version = "0.
|
|
986
|
+
version = "0.4.6"
|
|
987
987
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
988
|
-
checksum = "
|
|
988
|
+
checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea"
|
|
989
989
|
dependencies = [
|
|
990
990
|
"aho-corasick",
|
|
991
991
|
"memchr",
|
|
992
|
-
"regex-syntax",
|
|
992
|
+
"regex-syntax 0.8.3",
|
|
993
993
|
]
|
|
994
994
|
|
|
995
995
|
[[package]]
|
|
@@ -998,6 +998,12 @@ version = "0.7.4"
|
|
|
998
998
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
999
999
|
checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2"
|
|
1000
1000
|
|
|
1001
|
+
[[package]]
|
|
1002
|
+
name = "regex-syntax"
|
|
1003
|
+
version = "0.8.3"
|
|
1004
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1005
|
+
checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56"
|
|
1006
|
+
|
|
1001
1007
|
[[package]]
|
|
1002
1008
|
name = "rustc-hash"
|
|
1003
1009
|
version = "1.1.0"
|
|
@@ -1037,29 +1043,29 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
|
|
1037
1043
|
|
|
1038
1044
|
[[package]]
|
|
1039
1045
|
name = "serde"
|
|
1040
|
-
version = "1.0.
|
|
1046
|
+
version = "1.0.199"
|
|
1041
1047
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1042
|
-
checksum = "
|
|
1048
|
+
checksum = "0c9f6e76df036c77cd94996771fb40db98187f096dd0b9af39c6c6e452ba966a"
|
|
1043
1049
|
dependencies = [
|
|
1044
1050
|
"serde_derive",
|
|
1045
1051
|
]
|
|
1046
1052
|
|
|
1047
1053
|
[[package]]
|
|
1048
1054
|
name = "serde_derive"
|
|
1049
|
-
version = "1.0.
|
|
1055
|
+
version = "1.0.199"
|
|
1050
1056
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1051
|
-
checksum = "
|
|
1057
|
+
checksum = "11bd257a6541e141e42ca6d24ae26f7714887b47e89aa739099104c7e4d3b7fc"
|
|
1052
1058
|
dependencies = [
|
|
1053
1059
|
"proc-macro2",
|
|
1054
1060
|
"quote",
|
|
1055
|
-
"syn 2.0.
|
|
1061
|
+
"syn 2.0.60",
|
|
1056
1062
|
]
|
|
1057
1063
|
|
|
1058
1064
|
[[package]]
|
|
1059
1065
|
name = "serde_json"
|
|
1060
|
-
version = "1.0.
|
|
1066
|
+
version = "1.0.116"
|
|
1061
1067
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1062
|
-
checksum = "
|
|
1068
|
+
checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813"
|
|
1063
1069
|
dependencies = [
|
|
1064
1070
|
"indexmap",
|
|
1065
1071
|
"itoa",
|
|
@@ -1132,9 +1138,9 @@ dependencies = [
|
|
|
1132
1138
|
|
|
1133
1139
|
[[package]]
|
|
1134
1140
|
name = "syn"
|
|
1135
|
-
version = "2.0.
|
|
1141
|
+
version = "2.0.60"
|
|
1136
1142
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1137
|
-
checksum = "
|
|
1143
|
+
checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3"
|
|
1138
1144
|
dependencies = [
|
|
1139
1145
|
"proc-macro2",
|
|
1140
1146
|
"quote",
|
|
@@ -1197,7 +1203,7 @@ checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc"
|
|
|
1197
1203
|
dependencies = [
|
|
1198
1204
|
"proc-macro2",
|
|
1199
1205
|
"quote",
|
|
1200
|
-
"syn 2.0.
|
|
1206
|
+
"syn 2.0.60",
|
|
1201
1207
|
]
|
|
1202
1208
|
|
|
1203
1209
|
[[package]]
|
|
@@ -1247,9 +1253,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"
|
|
|
1247
1253
|
|
|
1248
1254
|
[[package]]
|
|
1249
1255
|
name = "uuid"
|
|
1250
|
-
version = "1.
|
|
1256
|
+
version = "1.8.0"
|
|
1251
1257
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1252
|
-
checksum = "
|
|
1258
|
+
checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0"
|
|
1253
1259
|
dependencies = [
|
|
1254
1260
|
"getrandom",
|
|
1255
1261
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "egglog-python"
|
|
3
|
-
version = "7.
|
|
3
|
+
version = "7.1.0"
|
|
4
4
|
edition = "2021"
|
|
5
5
|
|
|
6
6
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
@@ -12,16 +12,16 @@ crate-type = ["cdylib"]
|
|
|
12
12
|
pyo3 = { version = "0.21", features = ["extension-module"] }
|
|
13
13
|
|
|
14
14
|
# https://github.com/egraphs-good/egglog/compare/ceed816e9369570ffed9feeba157b19471dda70d...main
|
|
15
|
-
egglog = { git = "https://github.com/egraphs-good/egglog", rev = "
|
|
15
|
+
egglog = { git = "https://github.com/egraphs-good/egglog", rev = "fb4a9f114f9bb93154d6eff0dbab079b5cb4ebb6" }
|
|
16
16
|
# egglog = { git = "https://github.com/oflatt/egg-smol", branch = "oflatt-fast-terms" }
|
|
17
17
|
# egglog = { git = "https://github.com/saulshanabrook/egg-smol", rev = "38b3014b34399cc78887ede09c845b2a5d6c7d19" }
|
|
18
18
|
egraph-serialize = { git = "https://github.com/egraphs-good/egraph-serialize", rev = "5838c036623e91540831745b1574539e01c8cb23" }
|
|
19
19
|
serde_json = "*"
|
|
20
20
|
pyo3-log = "0.10.0"
|
|
21
|
-
log = "0.4.
|
|
22
|
-
lalrpop-util = { version = "0.20.
|
|
21
|
+
log = "0.4.21"
|
|
22
|
+
lalrpop-util = { version = "0.20.2", features = ["lexer"] }
|
|
23
23
|
ordered-float = "*"
|
|
24
|
-
uuid = { version = "1.
|
|
24
|
+
uuid = { version = "1.8.0", features = ["v4"] }
|
|
25
25
|
num-rational = "*"
|
|
26
26
|
|
|
27
27
|
[package.metadata.maturin]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: egglog
|
|
3
|
-
Version: 7.
|
|
3
|
+
Version: 7.1.0
|
|
4
4
|
Classifier: Environment :: MacOS X
|
|
5
5
|
Classifier: Environment :: Win32 (MS Windows)
|
|
6
6
|
Classifier: Intended Audience :: Developers
|
|
@@ -19,6 +19,17 @@ Classifier: Typing :: Typed
|
|
|
19
19
|
Requires-Dist: typing-extensions
|
|
20
20
|
Requires-Dist: black
|
|
21
21
|
Requires-Dist: graphviz
|
|
22
|
+
Requires-Dist: pytest; extra == 'test'
|
|
23
|
+
Requires-Dist: mypy; extra == 'test'
|
|
24
|
+
Requires-Dist: syrupy; extra == 'test'
|
|
25
|
+
Requires-Dist: egglog[array]; extra == 'test'
|
|
26
|
+
Requires-Dist: pytest-codspeed; extra == 'test'
|
|
27
|
+
Requires-Dist: pytest-benchmark; extra == 'test'
|
|
28
|
+
Requires-Dist: pytest-xdist; extra == 'test'
|
|
29
|
+
Requires-Dist: scikit-learn; extra == 'array'
|
|
30
|
+
Requires-Dist: array_api_compat; extra == 'array'
|
|
31
|
+
Requires-Dist: numba==0.59.1; extra == 'array'
|
|
32
|
+
Requires-Dist: llvmlite==0.42.0; extra == 'array'
|
|
22
33
|
Requires-Dist: pydata-sphinx-theme; extra == 'docs'
|
|
23
34
|
Requires-Dist: myst-nb; extra == 'docs'
|
|
24
35
|
Requires-Dist: sphinx-autodoc-typehints; extra == 'docs'
|
|
@@ -36,21 +47,10 @@ Requires-Dist: ruff; extra == 'dev'
|
|
|
36
47
|
Requires-Dist: mypy; extra == 'dev'
|
|
37
48
|
Requires-Dist: anywidget[dev]; extra == 'dev'
|
|
38
49
|
Requires-Dist: egglog[docs,test]; extra == 'dev'
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
Requires-Dist: numba==0.59.0rc1; extra == 'array'
|
|
42
|
-
Requires-Dist: llvmlite==0.42.0rc1; extra == 'array'
|
|
43
|
-
Requires-Dist: pytest; extra == 'test'
|
|
44
|
-
Requires-Dist: mypy; extra == 'test'
|
|
45
|
-
Requires-Dist: syrupy; extra == 'test'
|
|
46
|
-
Requires-Dist: egglog[array]; extra == 'test'
|
|
47
|
-
Requires-Dist: pytest-codspeed; extra == 'test'
|
|
48
|
-
Requires-Dist: pytest-benchmark; extra == 'test'
|
|
49
|
-
Requires-Dist: pytest-xdist; extra == 'test'
|
|
50
|
+
Provides-Extra: test
|
|
51
|
+
Provides-Extra: array
|
|
50
52
|
Provides-Extra: docs
|
|
51
53
|
Provides-Extra: dev
|
|
52
|
-
Provides-Extra: array
|
|
53
|
-
Provides-Extra: test
|
|
54
54
|
License-File: LICENSE
|
|
55
55
|
Summary: e-graphs in Python built around the the egglog rust library
|
|
56
56
|
License: MIT
|
|
@@ -59,7 +59,7 @@ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
|
59
59
|
|
|
60
60
|
# `egglog` Python wrapper
|
|
61
61
|
|
|
62
|
-
[](https://egglog-python.readthedocs.io/
|
|
62
|
+
[](https://egglog-python.readthedocs.io/latest/?badge=latest) [](https://github.com/egraphs-good/egglog-python/actions/workflows/CI.yml) [](https://pypi.org/project/egglog/) [](https://pypi.org/project/egglog/) [](https://pypi.org/project/egglog/) [](https://github.com/pre-commit/pre-commit) [](https://codspeed.io/egraphs-good/egglog-python)
|
|
63
63
|
|
|
64
64
|
`egglog` is a Python package that provides bindings to the Rust library [`egglog`](https://github.com/egraphs-good/egglog/),
|
|
65
65
|
allowing you to use e-graphs in Python for optimization, symbolic computation, and analysis.
|
egglog-7.1.0/README.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# `egglog` Python wrapper
|
|
2
|
+
|
|
3
|
+
[](https://egglog-python.readthedocs.io/latest/?badge=latest) [](https://github.com/egraphs-good/egglog-python/actions/workflows/CI.yml) [](https://pypi.org/project/egglog/) [](https://pypi.org/project/egglog/) [](https://pypi.org/project/egglog/) [](https://github.com/pre-commit/pre-commit) [](https://codspeed.io/egraphs-good/egglog-python)
|
|
4
|
+
|
|
5
|
+
`egglog` is a Python package that provides bindings to the Rust library [`egglog`](https://github.com/egraphs-good/egglog/),
|
|
6
|
+
allowing you to use e-graphs in Python for optimization, symbolic computation, and analysis.
|
|
7
|
+
|
|
8
|
+
Please see the [documentation](https://egglog-python.readthedocs.io/) for more information.
|
|
9
|
+
|
|
10
|
+
Come say hello [on the e-graphs Zulip](https://egraphs.zulipchat.com/#narrow/stream/375765-egglog/) or [open an issue](https://github.com/egraphs-good/egglog-python/issues/new/choose)!
|
|
@@ -4,6 +4,22 @@ _This project uses semantic versioning_
|
|
|
4
4
|
|
|
5
5
|
## UNRELEASED
|
|
6
6
|
|
|
7
|
+
## 7.1.0 (2024-05-03)
|
|
8
|
+
|
|
9
|
+
## New Feaatures
|
|
10
|
+
|
|
11
|
+
- Upgrade [egglog](https://github.com/egraphs-good/egglog/compare/0113af1d6476b75d4319591cc3d675f96a71cdc5...fb4a9f114f9bb93154d6eff0dbab079b5cb4ebb6) ([#143](https://github.com/egraphs-good/egglog-python/pull/143))
|
|
12
|
+
- Adds `bindings.UnstableCombinedRulset` to commands
|
|
13
|
+
- Adds `UnstableFn` sort
|
|
14
|
+
- Adds support for first class functions as values using Python's built in `Callable` syntax and `partial`.
|
|
15
|
+
- Adds way to combine ruleset with `r1 | r2` syntax or the experimental `unstable_combine_rulesets(*rs, name=None)` function.
|
|
16
|
+
|
|
17
|
+
## Minor improvements
|
|
18
|
+
|
|
19
|
+
- Fixes a bug where you could not write binary dunder methods (like `__add__`) that didn't have symetric arguments
|
|
20
|
+
- Use function name as ruleset name by default when creating ruleset from function
|
|
21
|
+
- Adds ability to refer to methods and property off of classes instead of only off of instances (i.e. `Math.__add__(x, y)`)
|
|
22
|
+
|
|
7
23
|
## 7.0.0 (2024-04-27)
|
|
8
24
|
|
|
9
25
|
- Defers adding rules in functions until they are used, so that you can use types that are not present yet.
|
|
@@ -388,3 +388,41 @@ Any function which mutates its first argument must return `None`. In egglog, thi
|
|
|
388
388
|
returns the type of its first argument.
|
|
389
389
|
|
|
390
390
|
Note that dunder methods such as `__setitem__` will automatically be marked as mutating their first argument.
|
|
391
|
+
|
|
392
|
+
## Functions as Values
|
|
393
|
+
|
|
394
|
+
In Python, functions are first class objects, and can be passed around as values. You can use the builtin `Callable`
|
|
395
|
+
type annotation to specify that a function is expected as an argument. You can then pass egglog functions directly
|
|
396
|
+
and call them with rewrite rules. For example, here is how you could define a `MathList` class which supports mapping:
|
|
397
|
+
|
|
398
|
+
```{code-cell} python
|
|
399
|
+
from collections.abc import Callable
|
|
400
|
+
from typing import ClassVar
|
|
401
|
+
|
|
402
|
+
class MathList(Expr):
|
|
403
|
+
EMPTY: ClassVar[MathList]
|
|
404
|
+
|
|
405
|
+
def append(self, x: Math) -> MathList: ...
|
|
406
|
+
|
|
407
|
+
def map(self, fn: Callable[[Math], Math]) -> MathList: ...
|
|
408
|
+
|
|
409
|
+
@ruleset
|
|
410
|
+
def math_list_ruleset(xs: MathList, x: Math, f: Callable[[Math], Math]):
|
|
411
|
+
yield rewrite(MathList.EMPTY.map(f)).to(MathList.EMPTY)
|
|
412
|
+
yield rewrite(xs.append(x).map(f)).to(xs.map(f).append(f(x)))
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
To support partial application, you can use the builtin `functools.partial` function:
|
|
416
|
+
|
|
417
|
+
```{code-cell} python
|
|
418
|
+
from functools import partial
|
|
419
|
+
|
|
420
|
+
x = MathList.EMPTY.append(Math(1))
|
|
421
|
+
added_two = x.map(partial(Math.__add__, Math(2)))
|
|
422
|
+
|
|
423
|
+
check_eq(added_two, MathList.EMPTY.append(Math(2) + Math(1)), math_list_ruleset.saturate())
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
Note that this is all built on the [unstable function support added as a sort to egglog](https://github.com/egraphs-good/egglog/pull/348).
|
|
427
|
+
While this sort is exposed directly at the high level with the `UnstableFn` class, we don't reccomend depending on it directly, and instead
|
|
428
|
+
using the builtin Python type annotations. This will allow us to change the implementation in the future without breaking user code.
|
|
@@ -32,8 +32,8 @@ dependencies = ["typing-extensions", "black", "graphviz"]
|
|
|
32
32
|
array = [
|
|
33
33
|
"scikit-learn",
|
|
34
34
|
"array_api_compat",
|
|
35
|
-
"numba==0.59.
|
|
36
|
-
"llvmlite==0.42.
|
|
35
|
+
"numba==0.59.1",
|
|
36
|
+
"llvmlite==0.42.0",
|
|
37
37
|
]
|
|
38
38
|
dev = ["pre-commit", "ruff", "mypy", "anywidget[dev]", "egglog[docs,test]"]
|
|
39
39
|
|
|
@@ -197,7 +197,6 @@ check_untyped_defs = true
|
|
|
197
197
|
strict_equality = true
|
|
198
198
|
warn_unused_configs = true
|
|
199
199
|
allow_redefinition = true
|
|
200
|
-
enable_incomplete_feature = ["Unpack"]
|
|
201
200
|
exclude = ["__snapshots__", "_build", "^conftest.py$"]
|
|
202
201
|
|
|
203
202
|
[tool.maturin]
|
|
@@ -494,6 +494,12 @@ class Relation:
|
|
|
494
494
|
class PrintOverallStatistics:
|
|
495
495
|
def __init__(self) -> None: ...
|
|
496
496
|
|
|
497
|
+
@final
|
|
498
|
+
class UnstableCombinedRuleset:
|
|
499
|
+
name: str
|
|
500
|
+
rulesets: list[str]
|
|
501
|
+
def __init__(self, name: str, rulesets: list[str]) -> None: ...
|
|
502
|
+
|
|
497
503
|
_Command: TypeAlias = (
|
|
498
504
|
SetOption
|
|
499
505
|
| Datatype
|
|
@@ -521,6 +527,7 @@ _Command: TypeAlias = (
|
|
|
521
527
|
| CheckProof
|
|
522
528
|
| Relation
|
|
523
529
|
| PrintOverallStatistics
|
|
530
|
+
| UnstableCombinedRuleset
|
|
524
531
|
)
|
|
525
532
|
|
|
526
533
|
def termdag_term_to_expr(termdag: TermDag, term: _Term) -> _Expr: ...
|
|
@@ -5,10 +5,14 @@ Builtin sorts and function to egg.
|
|
|
5
5
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
|
-
from
|
|
8
|
+
from functools import partial
|
|
9
|
+
from typing import TYPE_CHECKING, Generic, Protocol, TypeAlias, TypeVar, Union, overload
|
|
10
|
+
|
|
11
|
+
from typing_extensions import TypeVarTuple, Unpack
|
|
9
12
|
|
|
10
13
|
from .conversion import converter
|
|
11
14
|
from .egraph import Expr, Unit, function, method
|
|
15
|
+
from .runtime import RuntimeFunction
|
|
12
16
|
|
|
13
17
|
if TYPE_CHECKING:
|
|
14
18
|
from collections.abc import Callable
|
|
@@ -31,6 +35,7 @@ __all__ = [
|
|
|
31
35
|
"py_eval",
|
|
32
36
|
"py_exec",
|
|
33
37
|
"py_eval_fn",
|
|
38
|
+
"UnstableFn",
|
|
34
39
|
]
|
|
35
40
|
|
|
36
41
|
|
|
@@ -461,3 +466,38 @@ def py_exec(code: StringLike, globals: object = PyObject.dict(), locals: object
|
|
|
461
466
|
"""
|
|
462
467
|
Copies the locals, execs the Python code, and returns the locals with any updates.
|
|
463
468
|
"""
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
TS = TypeVarTuple("TS")
|
|
472
|
+
|
|
473
|
+
T1 = TypeVar("T1")
|
|
474
|
+
T2 = TypeVar("T2")
|
|
475
|
+
T3 = TypeVar("T3")
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
class UnstableFn(Expr, Generic[T, Unpack[TS]], builtin=True):
|
|
479
|
+
@overload
|
|
480
|
+
def __init__(self, f: Callable[[Unpack[TS]], T]) -> None: ...
|
|
481
|
+
|
|
482
|
+
@overload
|
|
483
|
+
def __init__(self, f: Callable[[T1, Unpack[TS]], T], _a: T1, /) -> None: ...
|
|
484
|
+
|
|
485
|
+
@overload
|
|
486
|
+
def __init__(self, f: Callable[[T1, T2, Unpack[TS]], T], _a: T1, _b: T2, /) -> None: ...
|
|
487
|
+
|
|
488
|
+
# Removing due to bug in MyPy
|
|
489
|
+
# https://github.com/python/mypy/issues/17212
|
|
490
|
+
# @overload
|
|
491
|
+
# def __init__(self, f: Callable[[T1, T2, T3, Unpack[TS]], T], _a: T1, _b: T2, _c: T3, /) -> None: ...
|
|
492
|
+
|
|
493
|
+
# etc, for partial application
|
|
494
|
+
|
|
495
|
+
@method(egg_fn="unstable-fn")
|
|
496
|
+
def __init__(self, f, *partial) -> None: ...
|
|
497
|
+
|
|
498
|
+
@method(egg_fn="unstable-app")
|
|
499
|
+
def __call__(self, *args: Unpack[TS]) -> T: ...
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
converter(RuntimeFunction, UnstableFn, UnstableFn)
|
|
503
|
+
converter(partial, UnstableFn, lambda p: UnstableFn(p.func, *p.args))
|