coconut-develop 3.1.2.post0.dev9__tar.gz → 3.1.2.post0.dev11__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.
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11/.claude}/CLAUDE.md +1 -1
- coconut_develop-3.1.2.post0.dev11/.claude/settings.local.json +18 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/DOCS.md +5 -4
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/PKG-INFO +52 -41
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/_coconut/__init__.pyi +8 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/compiler/compiler.py +61 -43
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/compiler/grammar.py +5 -2
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/compiler/header.py +11 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/compiler/matching.py +6 -5
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/compiler/templates/header.py_template +1 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/constants.py +46 -33
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/root.py +1 -1
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/tests/constants_test.py +4 -1
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/tests/main_test.py +16 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/tests/src/cocotest/agnostic/main.coco +8 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/tests/src/cocotest/agnostic/specific.coco +37 -0
- coconut_develop-3.1.2.post0.dev11/coconut/tests/src/cocotest/target_314/py314_test.coco +35 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut_develop.egg-info/SOURCES.txt +2 -1
- coconut_develop-3.1.2.post0.dev9/.claude/settings.local.json +0 -10
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/CONTRIBUTING.md +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/FAQ.md +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/HELP.md +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/LICENSE.txt +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/MANIFEST.in +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/README.rst +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/__coconut__/__init__.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/__coconut__/__init__.pyi +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/__coconut__/py.typed +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/_coconut/__init__.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/_coconut/py.typed +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/__coconut__.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/__coconut__.pyi +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/__init__.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/__init__.pyi +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/__main__.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/_pyparsing.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/api.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/api.pyi +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/command/__init__.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/command/__init__.pyi +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/command/cli.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/command/command.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/command/command.pyi +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/command/mypy.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/command/resources/zcoconut.pth +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/command/util.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/command/watch.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/compiler/__init__.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/compiler/util.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/convenience.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/convenience.pyi +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/exceptions.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/highlighter.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/icoconut/__init__.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/icoconut/__main__.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/icoconut/coconut/kernel.json +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/icoconut/coconut_py/kernel.json +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/icoconut/coconut_py2/kernel.json +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/icoconut/coconut_py3/kernel.json +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/icoconut/embed.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/icoconut/root.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/integrations.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/main.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/py.typed +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/requirements.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/terminal.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/tests/__init__.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/tests/__main__.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/tests/src/cocotest/agnostic/__init__.coco +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/tests/src/cocotest/agnostic/__main__.coco +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/tests/src/cocotest/agnostic/primary_1.coco +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/tests/src/cocotest/agnostic/primary_2.coco +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/tests/src/cocotest/agnostic/suite.coco +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/tests/src/cocotest/agnostic/tutorial.coco +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/tests/src/cocotest/agnostic/util.coco +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/tests/src/cocotest/non_strict/non_strict_test.coco +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/tests/src/cocotest/target_2/py2_test.coco +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/tests/src/cocotest/target_3/py3_test.coco +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/tests/src/cocotest/target_311/py311_test.coco +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/tests/src/cocotest/target_35/py35_test.coco +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/tests/src/cocotest/target_36/py36_test.coco +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/tests/src/cocotest/target_38/py38_test.coco +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/tests/src/cocotest/target_sys/target_sys_test.coco +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/tests/src/extras.coco +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/tests/src/importable.coco +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/tests/src/runnable.coco +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/tests/src/runner.coco +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/util.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/conf.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/pyproject.toml +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/setup.cfg +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/setup.py +0 -0
- {coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/xontrib/coconut.py +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
4
|
|
|
5
5
|
## Project Overview
|
|
6
|
-
Coconut is a functional programming language that compiles to Python. It adds features like pattern matching, algebraic data types, partial application, pipeline operators, and lazy evaluation on top of Python syntax. The compiler performs one-pass compilation using PyParsing.
|
|
6
|
+
Coconut is a functional programming language that compiles to Python. It adds features like pattern matching, algebraic data types, partial application, pipeline operators, and lazy evaluation on top of Python syntax. The compiler performs one-pass compilation using PyParsing. If you are ever uncertain about what the intended behavior should be, refer to the documentation in DOCS.md.
|
|
7
7
|
|
|
8
8
|
## Common Commands
|
|
9
9
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(cat:*)",
|
|
5
|
+
"Bash(python:*)",
|
|
6
|
+
"Bash(xonsh:*)",
|
|
7
|
+
"Bash(gh:*)",
|
|
8
|
+
"Bash(pip:*)",
|
|
9
|
+
"Bash(make test-tests:*)",
|
|
10
|
+
"WebSearch",
|
|
11
|
+
"WebFetch(domain:coconut.readthedocs.io)",
|
|
12
|
+
"WebFetch(domain:github.com)",
|
|
13
|
+
"WebFetch(domain:peps.python.org)",
|
|
14
|
+
"WebFetch(domain:pypi.org)",
|
|
15
|
+
"WebFetch(domain:discuss.python.org)"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -327,7 +327,7 @@ _Note: Periods are optional in target specifications, such that the target `27`
|
|
|
327
327
|
|
|
328
328
|
#### `strict` Mode
|
|
329
329
|
|
|
330
|
-
If the `--strict` (`-s` for short) flag is enabled, Coconut will perform additional checks on the code being compiled. It is recommended that you use the `--strict` flag if you are starting a new Coconut project, as it will help you write cleaner code. Specifically, the extra checks done by `--strict` are:
|
|
330
|
+
If the `--strict` (`-s` for short) flag is enabled, Coconut will perform additional checks on the code being compiled. It is recommended that you use the `--strict` flag if you are starting a new Coconut project, as it will help you write cleaner code. Almost all of these checks can be disabled on a line-by-line basis by adding `# NOQA` or `# noqa` comments. Specifically, the extra checks done by `--strict` are:
|
|
331
331
|
|
|
332
332
|
- disabling deprecated features (making them entirely unavailable to code compiled with `--strict`),
|
|
333
333
|
- errors instead of warnings on unused imports (unless they have a `# NOQA` or `# noqa` comment),
|
|
@@ -364,6 +364,7 @@ In addition to the newer Python features that Coconut can backport automatically
|
|
|
364
364
|
- [`aenum`](https://pypi.org/project/aenum) for backporting [`enum`](https://docs.python.org/3/library/enum.html).
|
|
365
365
|
- [`async_generator`](https://github.com/python-trio/async_generator) for backporting [`async` generators](https://peps.python.org/pep-0525/) and [`asynccontextmanager`](https://docs.python.org/3/library/contextlib.html#contextlib.asynccontextmanager).
|
|
366
366
|
- [`trollius`](https://pypi.python.org/pypi/trollius) for backporting [`async`/`await`](https://docs.python.org/3/library/asyncio-task.html) and [`asyncio`](https://docs.python.org/3/library/asyncio.html).
|
|
367
|
+
- [`tstr`](https://github.com/ilotoki0804/tstr) for backporting [template strings (`t"..."`)](https://peps.python.org/pep-0750/) on Python < 3.14.
|
|
367
368
|
|
|
368
369
|
Note that, when distributing compiled Coconut code, if you use any of these backports, you'll need to make sure that the requisite backport module is included as a dependency.
|
|
369
370
|
|
|
@@ -679,7 +680,7 @@ print(list(expnums))
|
|
|
679
680
|
|
|
680
681
|
### Pipes
|
|
681
682
|
|
|
682
|
-
Coconut uses pipe operators for pipeline-style function application. All the operators have a precedence
|
|
683
|
+
Coconut uses pipe operators for pipeline-style function application. All the operators have a precedence directly below [function composition pipes](#function-composition) and above comparisons (see the [precedence table](#precedence)), and are left-associative. All operators also support in-place versions (e.g. `|>=`). The different operators are:
|
|
683
684
|
```coconut
|
|
684
685
|
(|>) => pipe forward
|
|
685
686
|
(|*>) => multiple-argument pipe forward
|
|
@@ -752,7 +753,7 @@ async def do_stuff(some_data):
|
|
|
752
753
|
|
|
753
754
|
### Function Composition
|
|
754
755
|
|
|
755
|
-
Coconut has three basic function composition operators: `..`, `..>`, and `<..`. Both `..` and `<..` use math-style "backwards" function composition, where the first function is called last, while `..>` uses "forwards" function composition, where the first function is called first. Forwards and backwards function composition pipes cannot be used together in the same expression (unlike normal pipes) and have precedence
|
|
756
|
+
Coconut has three basic function composition operators: `..`, `..>`, and `<..`. Both `..` and `<..` use math-style "backwards" function composition, where the first function is called last, while `..>` uses "forwards" function composition, where the first function is called first. Forwards and backwards function composition pipes cannot be used together in the same expression (unlike normal pipes) and have a precedence directly below [the `None`-coalescing operator `??`](#none-coalescing) and above normal [pipes](#pipes) (see the [precedence table](#precedence)).
|
|
756
757
|
|
|
757
758
|
The `..>` and `<..` function composition pipe operators also have multi-arg, keyword, and None variants as with [normal pipes](#pipes). The full list of function composition pipe operators is:
|
|
758
759
|
```
|
|
@@ -967,7 +968,7 @@ Coconut provides `??` as a `None`-coalescing operator, similar to the `??` null-
|
|
|
967
968
|
|
|
968
969
|
Coconut's `??` operator evaluates to its left operand if that operand is not `None`, otherwise its right operand. The expression `foo ?? bar` evaluates to `foo` as long as it isn't `None`, and to `bar` if it is. The `None`-coalescing operator is short-circuiting, such that if the left operand is not `None`, the right operand won't be evaluated. This allows the right operand to be a potentially expensive operation without incurring any unnecessary cost.
|
|
969
970
|
|
|
970
|
-
The `None`-coalescing operator has a precedence
|
|
971
|
+
The `None`-coalescing operator has a precedence directly below [infix function calls](#infix-functions) and above [composition pipes](#function-composition) (see the [precedence table](#precedence)), and is left-associative.
|
|
971
972
|
|
|
972
973
|
##### Example
|
|
973
974
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: coconut-develop
|
|
3
|
-
Version: 3.1.2.post0.
|
|
3
|
+
Version: 3.1.2.post0.dev11
|
|
4
4
|
Summary: Simple, elegant, Pythonic functional programming.
|
|
5
5
|
Home-page: http://coconut-lang.org
|
|
6
6
|
Author: Evan Hubinger
|
|
@@ -47,11 +47,12 @@ Requires-Dist: ipython>=5.4; python_version < "3" and extra == "kernel"
|
|
|
47
47
|
Requires-Dist: ipython<7.10,>=7.9; (python_version >= "3" and python_version < "3.7") and extra == "kernel"
|
|
48
48
|
Requires-Dist: ipython>=7.34; (python_version >= "3.7" and python_version < "3.8") and extra == "kernel"
|
|
49
49
|
Requires-Dist: ipython>=8.12; (python_version >= "3.8" and python_version < "3.9") and extra == "kernel"
|
|
50
|
-
Requires-Dist: ipython>=8.18; (python_version >= "3.9" and python_version < "3.
|
|
51
|
-
Requires-Dist: ipython>=9; python_version >= "3.
|
|
50
|
+
Requires-Dist: ipython>=8.18; (python_version >= "3.9" and python_version < "3.11") and extra == "kernel"
|
|
51
|
+
Requires-Dist: ipython>=9; python_version >= "3.11" and extra == "kernel"
|
|
52
52
|
Requires-Dist: ipykernel>=4.10; python_version < "3" and extra == "kernel"
|
|
53
53
|
Requires-Dist: ipykernel>=5.5; (python_version >= "3" and python_version < "3.8") and extra == "kernel"
|
|
54
|
-
Requires-Dist: ipykernel>=6; python_version >= "3.8" and extra == "kernel"
|
|
54
|
+
Requires-Dist: ipykernel>=6; (python_version >= "3.8" and python_version < "3.10") and extra == "kernel"
|
|
55
|
+
Requires-Dist: ipykernel>=7; python_version >= "3.10" and extra == "kernel"
|
|
55
56
|
Requires-Dist: jupyter-client>=5.3; python_version < "3.5" and extra == "kernel"
|
|
56
57
|
Requires-Dist: jupyter-client<6.1.13,>=6.1.12; (python_version >= "3.5" and python_version < "3.6") and extra == "kernel"
|
|
57
58
|
Requires-Dist: jupyter-client>=7.1.2; python_version >= "3.6" and extra == "kernel"
|
|
@@ -61,7 +62,7 @@ Requires-Dist: pywinpty<0.6,>=0.5; (python_version < "3" and os_name == "nt") an
|
|
|
61
62
|
Provides-Extra: watch
|
|
62
63
|
Requires-Dist: watchdog>=0.10; extra == "watch"
|
|
63
64
|
Provides-Extra: mypy
|
|
64
|
-
Requires-Dist: mypy[python2]>=1.
|
|
65
|
+
Requires-Dist: mypy[python2]>=1.19; extra == "mypy"
|
|
65
66
|
Requires-Dist: types-backports>=0.1; extra == "mypy"
|
|
66
67
|
Requires-Dist: typing>=3.10; python_version < "3.5" and extra == "mypy"
|
|
67
68
|
Provides-Extra: pyright
|
|
@@ -70,24 +71,25 @@ Requires-Dist: types-backports>=0.1; extra == "pyright"
|
|
|
70
71
|
Requires-Dist: typing>=3.10; python_version < "3.5" and extra == "pyright"
|
|
71
72
|
Provides-Extra: xonsh
|
|
72
73
|
Requires-Dist: xonsh>=0.9; python_version < "3.6" and extra == "xonsh"
|
|
73
|
-
Requires-Dist: xonsh>=0.11; (python_version >= "3.6" and python_version < "3.
|
|
74
|
-
Requires-Dist: xonsh>=0.
|
|
74
|
+
Requires-Dist: xonsh>=0.11; (python_version >= "3.6" and python_version < "3.11") and extra == "xonsh"
|
|
75
|
+
Requires-Dist: xonsh>=0.22; python_version >= "3.11" and extra == "xonsh"
|
|
75
76
|
Provides-Extra: numpy
|
|
76
77
|
Requires-Dist: numpy>=1.16; (python_version < "3" and platform_python_implementation == "CPython") and extra == "numpy"
|
|
77
78
|
Requires-Dist: numpy>=1.18; (python_version >= "3.4" and python_version < "3.9") and extra == "numpy"
|
|
78
79
|
Requires-Dist: numpy>=1.26; python_version >= "3.9" and extra == "numpy"
|
|
79
80
|
Requires-Dist: pandas>=1.1; python_version >= "3.6" and extra == "numpy"
|
|
80
|
-
Requires-Dist: xarray>=2025; python_version >= "3.
|
|
81
|
+
Requires-Dist: xarray>=2025; python_version >= "3.10" and extra == "numpy"
|
|
81
82
|
Provides-Extra: jupyter
|
|
82
83
|
Requires-Dist: ipython>=5.4; python_version < "3" and extra == "jupyter"
|
|
83
84
|
Requires-Dist: ipython<7.10,>=7.9; (python_version >= "3" and python_version < "3.7") and extra == "jupyter"
|
|
84
85
|
Requires-Dist: ipython>=7.34; (python_version >= "3.7" and python_version < "3.8") and extra == "jupyter"
|
|
85
86
|
Requires-Dist: ipython>=8.12; (python_version >= "3.8" and python_version < "3.9") and extra == "jupyter"
|
|
86
|
-
Requires-Dist: ipython>=8.18; (python_version >= "3.9" and python_version < "3.
|
|
87
|
-
Requires-Dist: ipython>=9; python_version >= "3.
|
|
87
|
+
Requires-Dist: ipython>=8.18; (python_version >= "3.9" and python_version < "3.11") and extra == "jupyter"
|
|
88
|
+
Requires-Dist: ipython>=9; python_version >= "3.11" and extra == "jupyter"
|
|
88
89
|
Requires-Dist: ipykernel>=4.10; python_version < "3" and extra == "jupyter"
|
|
89
90
|
Requires-Dist: ipykernel>=5.5; (python_version >= "3" and python_version < "3.8") and extra == "jupyter"
|
|
90
|
-
Requires-Dist: ipykernel>=6; python_version >= "3.8" and extra == "jupyter"
|
|
91
|
+
Requires-Dist: ipykernel>=6; (python_version >= "3.8" and python_version < "3.10") and extra == "jupyter"
|
|
92
|
+
Requires-Dist: ipykernel>=7; python_version >= "3.10" and extra == "jupyter"
|
|
91
93
|
Requires-Dist: jupyter-client>=5.3; python_version < "3.5" and extra == "jupyter"
|
|
92
94
|
Requires-Dist: jupyter-client<6.1.13,>=6.1.12; (python_version >= "3.5" and python_version < "3.6") and extra == "jupyter"
|
|
93
95
|
Requires-Dist: jupyter-client>=7.1.2; python_version >= "3.6" and extra == "jupyter"
|
|
@@ -104,11 +106,12 @@ Requires-Dist: ipython>=5.4; python_version < "3" and extra == "jupyterlab"
|
|
|
104
106
|
Requires-Dist: ipython<7.10,>=7.9; (python_version >= "3" and python_version < "3.7") and extra == "jupyterlab"
|
|
105
107
|
Requires-Dist: ipython>=7.34; (python_version >= "3.7" and python_version < "3.8") and extra == "jupyterlab"
|
|
106
108
|
Requires-Dist: ipython>=8.12; (python_version >= "3.8" and python_version < "3.9") and extra == "jupyterlab"
|
|
107
|
-
Requires-Dist: ipython>=8.18; (python_version >= "3.9" and python_version < "3.
|
|
108
|
-
Requires-Dist: ipython>=9; python_version >= "3.
|
|
109
|
+
Requires-Dist: ipython>=8.18; (python_version >= "3.9" and python_version < "3.11") and extra == "jupyterlab"
|
|
110
|
+
Requires-Dist: ipython>=9; python_version >= "3.11" and extra == "jupyterlab"
|
|
109
111
|
Requires-Dist: ipykernel>=4.10; python_version < "3" and extra == "jupyterlab"
|
|
110
112
|
Requires-Dist: ipykernel>=5.5; (python_version >= "3" and python_version < "3.8") and extra == "jupyterlab"
|
|
111
|
-
Requires-Dist: ipykernel>=6; python_version >= "3.8" and extra == "jupyterlab"
|
|
113
|
+
Requires-Dist: ipykernel>=6; (python_version >= "3.8" and python_version < "3.10") and extra == "jupyterlab"
|
|
114
|
+
Requires-Dist: ipykernel>=7; python_version >= "3.10" and extra == "jupyterlab"
|
|
112
115
|
Requires-Dist: jupyter-client>=5.3; python_version < "3.5" and extra == "jupyterlab"
|
|
113
116
|
Requires-Dist: jupyter-client<6.1.13,>=6.1.12; (python_version >= "3.5" and python_version < "3.6") and extra == "jupyterlab"
|
|
114
117
|
Requires-Dist: jupyter-client>=7.1.2; python_version >= "3.6" and extra == "jupyterlab"
|
|
@@ -126,11 +129,12 @@ Requires-Dist: ipython>=5.4; python_version < "3" and extra == "jupytext"
|
|
|
126
129
|
Requires-Dist: ipython<7.10,>=7.9; (python_version >= "3" and python_version < "3.7") and extra == "jupytext"
|
|
127
130
|
Requires-Dist: ipython>=7.34; (python_version >= "3.7" and python_version < "3.8") and extra == "jupytext"
|
|
128
131
|
Requires-Dist: ipython>=8.12; (python_version >= "3.8" and python_version < "3.9") and extra == "jupytext"
|
|
129
|
-
Requires-Dist: ipython>=8.18; (python_version >= "3.9" and python_version < "3.
|
|
130
|
-
Requires-Dist: ipython>=9; python_version >= "3.
|
|
132
|
+
Requires-Dist: ipython>=8.18; (python_version >= "3.9" and python_version < "3.11") and extra == "jupytext"
|
|
133
|
+
Requires-Dist: ipython>=9; python_version >= "3.11" and extra == "jupytext"
|
|
131
134
|
Requires-Dist: ipykernel>=4.10; python_version < "3" and extra == "jupytext"
|
|
132
135
|
Requires-Dist: ipykernel>=5.5; (python_version >= "3" and python_version < "3.8") and extra == "jupytext"
|
|
133
|
-
Requires-Dist: ipykernel>=6; python_version >= "3.8" and extra == "jupytext"
|
|
136
|
+
Requires-Dist: ipykernel>=6; (python_version >= "3.8" and python_version < "3.10") and extra == "jupytext"
|
|
137
|
+
Requires-Dist: ipykernel>=7; python_version >= "3.10" and extra == "jupytext"
|
|
134
138
|
Requires-Dist: jupyter-client>=5.3; python_version < "3.5" and extra == "jupytext"
|
|
135
139
|
Requires-Dist: jupyter-client<6.1.13,>=6.1.12; (python_version >= "3.5" and python_version < "3.6") and extra == "jupytext"
|
|
136
140
|
Requires-Dist: jupyter-client>=7.1.2; python_version >= "3.6" and extra == "jupytext"
|
|
@@ -148,11 +152,12 @@ Requires-Dist: ipython>=5.4; python_version < "3" and extra == "all"
|
|
|
148
152
|
Requires-Dist: ipython<7.10,>=7.9; (python_version >= "3" and python_version < "3.7") and extra == "all"
|
|
149
153
|
Requires-Dist: ipython>=7.34; (python_version >= "3.7" and python_version < "3.8") and extra == "all"
|
|
150
154
|
Requires-Dist: ipython>=8.12; (python_version >= "3.8" and python_version < "3.9") and extra == "all"
|
|
151
|
-
Requires-Dist: ipython>=8.18; (python_version >= "3.9" and python_version < "3.
|
|
152
|
-
Requires-Dist: ipython>=9; python_version >= "3.
|
|
155
|
+
Requires-Dist: ipython>=8.18; (python_version >= "3.9" and python_version < "3.11") and extra == "all"
|
|
156
|
+
Requires-Dist: ipython>=9; python_version >= "3.11" and extra == "all"
|
|
153
157
|
Requires-Dist: ipykernel>=4.10; python_version < "3" and extra == "all"
|
|
154
158
|
Requires-Dist: ipykernel>=5.5; (python_version >= "3" and python_version < "3.8") and extra == "all"
|
|
155
|
-
Requires-Dist: ipykernel>=6; python_version >= "3.8" and extra == "all"
|
|
159
|
+
Requires-Dist: ipykernel>=6; (python_version >= "3.8" and python_version < "3.10") and extra == "all"
|
|
160
|
+
Requires-Dist: ipykernel>=7; python_version >= "3.10" and extra == "all"
|
|
156
161
|
Requires-Dist: jupyter-client>=5.3; python_version < "3.5" and extra == "all"
|
|
157
162
|
Requires-Dist: jupyter-client<6.1.13,>=6.1.12; (python_version >= "3.5" and python_version < "3.6") and extra == "all"
|
|
158
163
|
Requires-Dist: jupyter-client>=7.1.2; python_version >= "3.6" and extra == "all"
|
|
@@ -160,18 +165,18 @@ Requires-Dist: jedi<0.18,>=0.17; python_version < "3.9" and extra == "all"
|
|
|
160
165
|
Requires-Dist: jedi>=0.19; python_version >= "3.9" and extra == "all"
|
|
161
166
|
Requires-Dist: pywinpty<0.6,>=0.5; (python_version < "3" and os_name == "nt") and extra == "all"
|
|
162
167
|
Requires-Dist: watchdog>=0.10; extra == "all"
|
|
163
|
-
Requires-Dist: mypy[python2]>=1.
|
|
168
|
+
Requires-Dist: mypy[python2]>=1.19; extra == "all"
|
|
164
169
|
Requires-Dist: types-backports>=0.1; extra == "all"
|
|
165
170
|
Requires-Dist: typing>=3.10; python_version < "3.5" and extra == "all"
|
|
166
171
|
Requires-Dist: pyright>=1.1; extra == "all"
|
|
167
172
|
Requires-Dist: xonsh>=0.9; python_version < "3.6" and extra == "all"
|
|
168
|
-
Requires-Dist: xonsh>=0.11; (python_version >= "3.6" and python_version < "3.
|
|
169
|
-
Requires-Dist: xonsh>=0.
|
|
173
|
+
Requires-Dist: xonsh>=0.11; (python_version >= "3.6" and python_version < "3.11") and extra == "all"
|
|
174
|
+
Requires-Dist: xonsh>=0.22; python_version >= "3.11" and extra == "all"
|
|
170
175
|
Requires-Dist: numpy>=1.16; (python_version < "3" and platform_python_implementation == "CPython") and extra == "all"
|
|
171
176
|
Requires-Dist: numpy>=1.18; (python_version >= "3.4" and python_version < "3.9") and extra == "all"
|
|
172
177
|
Requires-Dist: numpy>=1.26; python_version >= "3.9" and extra == "all"
|
|
173
178
|
Requires-Dist: pandas>=1.1; python_version >= "3.6" and extra == "all"
|
|
174
|
-
Requires-Dist: xarray>=2025; python_version >= "3.
|
|
179
|
+
Requires-Dist: xarray>=2025; python_version >= "3.10" and extra == "all"
|
|
175
180
|
Requires-Dist: jupyter>=1.1; extra == "all"
|
|
176
181
|
Requires-Dist: jupyter-console>=5.2; python_version < "3.5" and extra == "all"
|
|
177
182
|
Requires-Dist: jupyter-console>=6.1; (python_version >= "3.5" and python_version < "3.7") and extra == "all"
|
|
@@ -184,11 +189,12 @@ Requires-Dist: ipython>=5.4; python_version < "3" and extra == "ipython"
|
|
|
184
189
|
Requires-Dist: ipython<7.10,>=7.9; (python_version >= "3" and python_version < "3.7") and extra == "ipython"
|
|
185
190
|
Requires-Dist: ipython>=7.34; (python_version >= "3.7" and python_version < "3.8") and extra == "ipython"
|
|
186
191
|
Requires-Dist: ipython>=8.12; (python_version >= "3.8" and python_version < "3.9") and extra == "ipython"
|
|
187
|
-
Requires-Dist: ipython>=8.18; (python_version >= "3.9" and python_version < "3.
|
|
188
|
-
Requires-Dist: ipython>=9; python_version >= "3.
|
|
192
|
+
Requires-Dist: ipython>=8.18; (python_version >= "3.9" and python_version < "3.11") and extra == "ipython"
|
|
193
|
+
Requires-Dist: ipython>=9; python_version >= "3.11" and extra == "ipython"
|
|
189
194
|
Requires-Dist: ipykernel>=4.10; python_version < "3" and extra == "ipython"
|
|
190
195
|
Requires-Dist: ipykernel>=5.5; (python_version >= "3" and python_version < "3.8") and extra == "ipython"
|
|
191
|
-
Requires-Dist: ipykernel>=6; python_version >= "3.8" and extra == "ipython"
|
|
196
|
+
Requires-Dist: ipykernel>=6; (python_version >= "3.8" and python_version < "3.10") and extra == "ipython"
|
|
197
|
+
Requires-Dist: ipykernel>=7; python_version >= "3.10" and extra == "ipython"
|
|
192
198
|
Requires-Dist: jupyter-client>=5.3; python_version < "3.5" and extra == "ipython"
|
|
193
199
|
Requires-Dist: jupyter-client<6.1.13,>=6.1.12; (python_version >= "3.5" and python_version < "3.6") and extra == "ipython"
|
|
194
200
|
Requires-Dist: jupyter-client>=7.1.2; python_version >= "3.6" and extra == "ipython"
|
|
@@ -218,11 +224,12 @@ Requires-Dist: ipython>=5.4; python_version < "3" and extra == "tests"
|
|
|
218
224
|
Requires-Dist: ipython<7.10,>=7.9; (python_version >= "3" and python_version < "3.7") and extra == "tests"
|
|
219
225
|
Requires-Dist: ipython>=7.34; (python_version >= "3.7" and python_version < "3.8") and extra == "tests"
|
|
220
226
|
Requires-Dist: ipython>=8.12; (python_version >= "3.8" and python_version < "3.9") and extra == "tests"
|
|
221
|
-
Requires-Dist: ipython>=8.18; (python_version >= "3.9" and python_version < "3.
|
|
222
|
-
Requires-Dist: ipython>=9; python_version >= "3.
|
|
227
|
+
Requires-Dist: ipython>=8.18; (python_version >= "3.9" and python_version < "3.11") and extra == "tests"
|
|
228
|
+
Requires-Dist: ipython>=9; python_version >= "3.11" and extra == "tests"
|
|
223
229
|
Requires-Dist: ipykernel>=4.10; python_version < "3" and extra == "tests"
|
|
224
230
|
Requires-Dist: ipykernel>=5.5; (python_version >= "3" and python_version < "3.8") and extra == "tests"
|
|
225
|
-
Requires-Dist: ipykernel>=6; python_version >= "3.8" and extra == "tests"
|
|
231
|
+
Requires-Dist: ipykernel>=6; (python_version >= "3.8" and python_version < "3.10") and extra == "tests"
|
|
232
|
+
Requires-Dist: ipykernel>=7; python_version >= "3.10" and extra == "tests"
|
|
226
233
|
Requires-Dist: jupyter-client>=5.3; python_version < "3.5" and extra == "tests"
|
|
227
234
|
Requires-Dist: jupyter-client<6.1.13,>=6.1.12; (python_version >= "3.5" and python_version < "3.6") and extra == "tests"
|
|
228
235
|
Requires-Dist: jupyter-client>=7.1.2; python_version >= "3.6" and extra == "tests"
|
|
@@ -239,11 +246,12 @@ Requires-Dist: ipython>=5.4; python_version < "3" and extra == "dev"
|
|
|
239
246
|
Requires-Dist: ipython<7.10,>=7.9; (python_version >= "3" and python_version < "3.7") and extra == "dev"
|
|
240
247
|
Requires-Dist: ipython>=7.34; (python_version >= "3.7" and python_version < "3.8") and extra == "dev"
|
|
241
248
|
Requires-Dist: ipython>=8.12; (python_version >= "3.8" and python_version < "3.9") and extra == "dev"
|
|
242
|
-
Requires-Dist: ipython>=8.18; (python_version >= "3.9" and python_version < "3.
|
|
243
|
-
Requires-Dist: ipython>=9; python_version >= "3.
|
|
249
|
+
Requires-Dist: ipython>=8.18; (python_version >= "3.9" and python_version < "3.11") and extra == "dev"
|
|
250
|
+
Requires-Dist: ipython>=9; python_version >= "3.11" and extra == "dev"
|
|
244
251
|
Requires-Dist: ipykernel>=4.10; python_version < "3" and extra == "dev"
|
|
245
252
|
Requires-Dist: ipykernel>=5.5; (python_version >= "3" and python_version < "3.8") and extra == "dev"
|
|
246
|
-
Requires-Dist: ipykernel>=6; python_version >= "3.8" and extra == "dev"
|
|
253
|
+
Requires-Dist: ipykernel>=6; (python_version >= "3.8" and python_version < "3.10") and extra == "dev"
|
|
254
|
+
Requires-Dist: ipykernel>=7; python_version >= "3.10" and extra == "dev"
|
|
247
255
|
Requires-Dist: jupyter-client>=5.3; python_version < "3.5" and extra == "dev"
|
|
248
256
|
Requires-Dist: jupyter-client<6.1.13,>=6.1.12; (python_version >= "3.5" and python_version < "3.6") and extra == "dev"
|
|
249
257
|
Requires-Dist: jupyter-client>=7.1.2; python_version >= "3.6" and extra == "dev"
|
|
@@ -251,18 +259,18 @@ Requires-Dist: jedi<0.18,>=0.17; python_version < "3.9" and extra == "dev"
|
|
|
251
259
|
Requires-Dist: jedi>=0.19; python_version >= "3.9" and extra == "dev"
|
|
252
260
|
Requires-Dist: pywinpty<0.6,>=0.5; (python_version < "3" and os_name == "nt") and extra == "dev"
|
|
253
261
|
Requires-Dist: watchdog>=0.10; extra == "dev"
|
|
254
|
-
Requires-Dist: mypy[python2]>=1.
|
|
262
|
+
Requires-Dist: mypy[python2]>=1.19; extra == "dev"
|
|
255
263
|
Requires-Dist: types-backports>=0.1; extra == "dev"
|
|
256
264
|
Requires-Dist: typing>=3.10; python_version < "3.5" and extra == "dev"
|
|
257
265
|
Requires-Dist: pyright>=1.1; extra == "dev"
|
|
258
266
|
Requires-Dist: xonsh>=0.9; python_version < "3.6" and extra == "dev"
|
|
259
|
-
Requires-Dist: xonsh>=0.11; (python_version >= "3.6" and python_version < "3.
|
|
260
|
-
Requires-Dist: xonsh>=0.
|
|
267
|
+
Requires-Dist: xonsh>=0.11; (python_version >= "3.6" and python_version < "3.11") and extra == "dev"
|
|
268
|
+
Requires-Dist: xonsh>=0.22; python_version >= "3.11" and extra == "dev"
|
|
261
269
|
Requires-Dist: numpy>=1.16; (python_version < "3" and platform_python_implementation == "CPython") and extra == "dev"
|
|
262
270
|
Requires-Dist: numpy>=1.18; (python_version >= "3.4" and python_version < "3.9") and extra == "dev"
|
|
263
271
|
Requires-Dist: numpy>=1.26; python_version >= "3.9" and extra == "dev"
|
|
264
272
|
Requires-Dist: pandas>=1.1; python_version >= "3.6" and extra == "dev"
|
|
265
|
-
Requires-Dist: xarray>=2025; python_version >= "3.
|
|
273
|
+
Requires-Dist: xarray>=2025; python_version >= "3.10" and extra == "dev"
|
|
266
274
|
Requires-Dist: jupyter>=1.1; extra == "dev"
|
|
267
275
|
Requires-Dist: jupyter-console>=5.2; python_version < "3.5" and extra == "dev"
|
|
268
276
|
Requires-Dist: jupyter-console>=6.1; (python_version >= "3.5" and python_version < "3.7") and extra == "dev"
|
|
@@ -288,22 +296,25 @@ Requires-Dist: requests>=2.32; extra == "dev"
|
|
|
288
296
|
Requires-Dist: vprof>=0.36; extra == "dev"
|
|
289
297
|
Requires-Dist: py-spy>=0.4; extra == "dev"
|
|
290
298
|
Requires-Dist: argparse>=1.4; python_version < "2.7"
|
|
291
|
-
Requires-Dist: psutil>=
|
|
299
|
+
Requires-Dist: psutil>=6; python_version >= "2.7" and python_version < "3"
|
|
300
|
+
Requires-Dist: psutil>=7; python_version >= "3"
|
|
301
|
+
Requires-Dist: prompt_toolkit>=1; python_version >= "3"
|
|
292
302
|
Requires-Dist: futures>=3.4; python_version < "3"
|
|
293
303
|
Requires-Dist: backports.functools-lru-cache>=1.6; python_version < "3"
|
|
294
304
|
Requires-Dist: prompt_toolkit<2,>=1; python_version < "3"
|
|
295
|
-
Requires-Dist: prompt_toolkit>=1; python_version >= "3"
|
|
296
305
|
Requires-Dist: pygments>=2.3; python_version < "3.9"
|
|
297
306
|
Requires-Dist: pygments>=2.19; python_version >= "3.9"
|
|
307
|
+
Requires-Dist: typing_extensions>=4.15; python_version >= "3.9"
|
|
298
308
|
Requires-Dist: typing_extensions>=3.10; python_version < "3.6"
|
|
299
309
|
Requires-Dist: typing_extensions>=4.1; python_version >= "3.6" and python_version < "3.7"
|
|
300
310
|
Requires-Dist: dataclasses>=0.8; python_version >= "3.6" and python_version < "3.7"
|
|
301
311
|
Requires-Dist: typing_extensions>=4.7; python_version >= "3.7" and python_version < "3.8"
|
|
302
|
-
Requires-Dist: typing_extensions>=4.
|
|
312
|
+
Requires-Dist: typing_extensions>=4.12; python_version >= "3.8" and python_version < "3.9"
|
|
303
313
|
Requires-Dist: trollius>=2.2; python_version < "3" and platform_python_implementation == "CPython"
|
|
304
|
-
Requires-Dist: aenum>=3.1.
|
|
314
|
+
Requires-Dist: aenum>=3.1.16; python_version < "3.4"
|
|
305
315
|
Requires-Dist: typing>=3.10; python_version < "3.5"
|
|
306
316
|
Requires-Dist: async_generator>=1.10; python_version >= "3.5"
|
|
317
|
+
Requires-Dist: tstr>=0.4; python_version >= "3.10"
|
|
307
318
|
Requires-Dist: exceptiongroup>=1; python_version >= "3.7" and python_version < "3.11"
|
|
308
319
|
Requires-Dist: anyio>=3; python_version >= "3.6"
|
|
309
320
|
Requires-Dist: cPyparsing<2.4.7.2.5,>=2.4.7.2.4.1; platform_python_implementation == "CPython"
|
{coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/_coconut/__init__.pyi
RENAMED
|
@@ -59,6 +59,13 @@ else:
|
|
|
59
59
|
|
|
60
60
|
if sys.version_info >= (3, 5):
|
|
61
61
|
import async_generator as _async_generator # type: ignore
|
|
62
|
+
else:
|
|
63
|
+
_async_generator = ... # type: ignore
|
|
64
|
+
|
|
65
|
+
if sys.version_info >= (3, 14):
|
|
66
|
+
import tstr as _tstr # type: ignore
|
|
67
|
+
else:
|
|
68
|
+
_tstr = ... # type: ignore
|
|
62
69
|
|
|
63
70
|
try:
|
|
64
71
|
import numpy as _numpy # type: ignore
|
|
@@ -95,6 +102,7 @@ copyreg = _copyreg
|
|
|
95
102
|
asyncio = _asyncio
|
|
96
103
|
asyncio_Return = StopIteration
|
|
97
104
|
async_generator = _async_generator
|
|
105
|
+
tstr = _tstr
|
|
98
106
|
pickle = _pickle
|
|
99
107
|
if sys.version_info >= (2, 7):
|
|
100
108
|
OrderedDict = collections.OrderedDict
|
{coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/compiler/compiler.py
RENAMED
|
@@ -73,7 +73,7 @@ from coconut.constants import (
|
|
|
73
73
|
tabideal,
|
|
74
74
|
match_to_args_var,
|
|
75
75
|
match_to_kwargs_var,
|
|
76
|
-
|
|
76
|
+
new_to_old_stdlib,
|
|
77
77
|
reserved_prefix,
|
|
78
78
|
function_match_error_var,
|
|
79
79
|
legal_indent_chars,
|
|
@@ -858,6 +858,7 @@ class Compiler(Grammar, pickleable_obj):
|
|
|
858
858
|
cls.testlist_star_namedexpr <<= attach(cls.testlist_star_namedexpr_tokens, cls.method("testlist_star_expr_handle"))
|
|
859
859
|
cls.ellipsis <<= attach(cls.ellipsis_tokens, cls.method("ellipsis_handle"))
|
|
860
860
|
cls.f_string <<= attach(cls.f_string_tokens, cls.method("f_string_handle"))
|
|
861
|
+
cls.t_string <<= attach(cls.t_string_tokens, cls.method("t_string_handle"))
|
|
861
862
|
cls.funcname_typeparams <<= attach(cls.funcname_typeparams_tokens, cls.method("funcname_typeparams_handle"))
|
|
862
863
|
|
|
863
864
|
# standard handlers of the form name <<= attach(name_ref, method("name_handle"))
|
|
@@ -1045,6 +1046,18 @@ class Compiler(Grammar, pickleable_obj):
|
|
|
1045
1046
|
else:
|
|
1046
1047
|
self.syntax_warning(*args, **kwargs)
|
|
1047
1048
|
|
|
1049
|
+
def strict_qa_error(self, msg, original, loc, **kwargs):
|
|
1050
|
+
"""Strict error or warn an error that should be disabled by a NOQA comment."""
|
|
1051
|
+
ln = self.adjust(lineno(loc, original))
|
|
1052
|
+
comment = self.reformat(" ".join(self.comments[ln]), ignore_errors=True)
|
|
1053
|
+
if not self.noqa_regex.search(comment):
|
|
1054
|
+
self.strict_err_or_warn(
|
|
1055
|
+
msg + " (add '# NOQA' to suppress)",
|
|
1056
|
+
original,
|
|
1057
|
+
loc,
|
|
1058
|
+
**kwargs,
|
|
1059
|
+
)
|
|
1060
|
+
|
|
1048
1061
|
@contextmanager
|
|
1049
1062
|
def complain_on_err(self):
|
|
1050
1063
|
"""Complain about any parsing-related errors raised inside."""
|
|
@@ -1404,30 +1417,19 @@ class Compiler(Grammar, pickleable_obj):
|
|
|
1404
1417
|
elif inputstring is not None and not inner:
|
|
1405
1418
|
logger.log("No streamlining done for input of length {length}.".format(length=input_len))
|
|
1406
1419
|
|
|
1407
|
-
def qa_error(self, msg, original, loc):
|
|
1408
|
-
"""Strict error or warn an error that should be disabled by a NOQA comment."""
|
|
1409
|
-
ln = self.adjust(lineno(loc, original))
|
|
1410
|
-
comment = self.reformat(" ".join(self.comments[ln]), ignore_errors=True)
|
|
1411
|
-
if not self.noqa_regex.search(comment):
|
|
1412
|
-
self.strict_err_or_warn(
|
|
1413
|
-
msg + " (add '# NOQA' to suppress)",
|
|
1414
|
-
original,
|
|
1415
|
-
loc,
|
|
1416
|
-
endpoint=False,
|
|
1417
|
-
)
|
|
1418
|
-
|
|
1419
1420
|
def run_final_checks(self, original, keep_state=False):
|
|
1420
1421
|
"""Run post-parsing checks to raise any necessary errors/warnings."""
|
|
1421
1422
|
# only check for unused imports/etc. if we're not keeping state accross parses
|
|
1422
1423
|
if not keep_state:
|
|
1423
1424
|
for name, info in self.name_info.items():
|
|
1425
|
+
# always use endpoint=False otherwise the endpoint will be the end of the file since we've finished parsing
|
|
1424
1426
|
if info["imported"] and not info["referenced"]:
|
|
1425
1427
|
for loc in info["imported"]:
|
|
1426
|
-
self.
|
|
1428
|
+
self.strict_qa_error("found unused import " + repr(self.reformat(name, ignore_errors=True)), original, loc, endpoint=False)
|
|
1427
1429
|
if not self.star_import: # only check for undefined names when there are no * imports
|
|
1428
1430
|
if name not in all_builtins and info["referenced"] and not (info["assigned"] or info["imported"]):
|
|
1429
1431
|
for loc in info["referenced"]:
|
|
1430
|
-
self.
|
|
1432
|
+
self.strict_qa_error("found undefined name " + repr(self.reformat(name, ignore_errors=True)), original, loc, endpoint=False)
|
|
1431
1433
|
|
|
1432
1434
|
def pickle_cache(self, original, cache_path, include_incremental=True):
|
|
1433
1435
|
"""Pickle the pyparsing cache for original to cache_path."""
|
|
@@ -3134,7 +3136,7 @@ else:
|
|
|
3134
3136
|
elif arg[1] == "=":
|
|
3135
3137
|
kwd_args.append(arg[0] + "=" + arg[0])
|
|
3136
3138
|
elif arg[0] == "...":
|
|
3137
|
-
self.
|
|
3139
|
+
self.strict_qa_error("'...={name}' shorthand is deprecated, use '{name}=' shorthand instead".format(name=arg[1]), original, loc)
|
|
3138
3140
|
kwd_args.append(arg[1] + "=" + arg[1])
|
|
3139
3141
|
else:
|
|
3140
3142
|
kwd_args.append(argstr)
|
|
@@ -3355,7 +3357,7 @@ else:
|
|
|
3355
3357
|
elif trailer[0] == "[]":
|
|
3356
3358
|
out = "_coconut_partial(_coconut.operator.getitem, " + out + ")"
|
|
3357
3359
|
elif trailer[0] == ".":
|
|
3358
|
-
self.
|
|
3360
|
+
self.strict_qa_error("'obj.' as a shorthand for 'getattr$(obj)' is deprecated (just use the getattr partial)", original, loc)
|
|
3359
3361
|
out = "_coconut_partial(_coconut.getattr, " + out + ")"
|
|
3360
3362
|
elif trailer[0] == "type:[]":
|
|
3361
3363
|
out = "_coconut.typing.Sequence[" + out + "]"
|
|
@@ -3574,7 +3576,7 @@ while True:
|
|
|
3574
3576
|
and not kwd_args
|
|
3575
3577
|
and not dubstar_args
|
|
3576
3578
|
):
|
|
3577
|
-
self.
|
|
3579
|
+
self.strict_qa_error("unnecessary inheriting from object (Coconut does this automatically)", original, loc)
|
|
3578
3580
|
|
|
3579
3581
|
# universalize if not Python 3
|
|
3580
3582
|
if not self.target.startswith("3"):
|
|
@@ -3919,7 +3921,7 @@ def __hash__(self):
|
|
|
3919
3921
|
if item == "=":
|
|
3920
3922
|
item = name
|
|
3921
3923
|
elif name == "...":
|
|
3922
|
-
self.
|
|
3924
|
+
self.strict_qa_error("'...={item}' shorthand is deprecated, use '{item}=' shorthand instead".format(item=item), original, loc)
|
|
3923
3925
|
name = item
|
|
3924
3926
|
names.append(name)
|
|
3925
3927
|
items.append(item)
|
|
@@ -3987,8 +3989,8 @@ def __hash__(self):
|
|
|
3987
3989
|
for i in reversed(range(1, len(path) + 1)):
|
|
3988
3990
|
base, exts = ".".join(path[:i]), path[i:]
|
|
3989
3991
|
clean_base = base.replace("/", "")
|
|
3990
|
-
if clean_base in
|
|
3991
|
-
old_imp, version_check =
|
|
3992
|
+
if clean_base in new_to_old_stdlib:
|
|
3993
|
+
old_imp, version_check = new_to_old_stdlib[clean_base]
|
|
3992
3994
|
if old_imp.endswith("#"):
|
|
3993
3995
|
type_ignore = True
|
|
3994
3996
|
old_imp = old_imp[:-1]
|
|
@@ -4052,7 +4054,7 @@ if {store_var} is not _coconut_sentinel:
|
|
|
4052
4054
|
elif len(tokens) == 2:
|
|
4053
4055
|
imp_from, imports = tokens
|
|
4054
4056
|
if imp_from == "__future__":
|
|
4055
|
-
self.
|
|
4057
|
+
self.strict_qa_error("unnecessary from __future__ import (Coconut does these automatically)", original, loc)
|
|
4056
4058
|
return ""
|
|
4057
4059
|
else:
|
|
4058
4060
|
raise CoconutInternalException("invalid import tokens", tokens)
|
|
@@ -4355,7 +4357,7 @@ def {name}({match_func_paramdef}):
|
|
|
4355
4357
|
got_kwds, params, typedef, stmts_toks, followed_by = tokens
|
|
4356
4358
|
|
|
4357
4359
|
if followed_by == ",":
|
|
4358
|
-
self.
|
|
4360
|
+
self.strict_qa_error("found statement lambda followed by comma; this isn't recommended as it can be unclear whether the comma is inside or outside the lambda (just wrap the lambda in parentheses)", original, loc)
|
|
4359
4361
|
else:
|
|
4360
4362
|
internal_assert(followed_by == "", "invalid stmt_lambdef followed_by", followed_by)
|
|
4361
4363
|
|
|
@@ -4614,7 +4616,7 @@ __annotations__["{name}"] = {annotation}
|
|
|
4614
4616
|
raise CoconutInternalException("invalid case tokens", tokens)
|
|
4615
4617
|
|
|
4616
4618
|
if block_kwd == "case":
|
|
4617
|
-
self.
|
|
4619
|
+
self.strict_qa_error(
|
|
4618
4620
|
"deprecated case keyword at top level in case ...: match ...: block (use Python 3.10 match ...: case ...: syntax instead)",
|
|
4619
4621
|
original,
|
|
4620
4622
|
loc,
|
|
@@ -4644,8 +4646,8 @@ __annotations__["{name}"] = {annotation}
|
|
|
4644
4646
|
out += "if not " + check_var + default
|
|
4645
4647
|
return out
|
|
4646
4648
|
|
|
4647
|
-
def f_string_handle(self, original, loc, tokens):
|
|
4648
|
-
"""Process Python 3.6 format strings."""
|
|
4649
|
+
def f_string_handle(self, original, loc, tokens, is_t=False):
|
|
4650
|
+
"""Process Python 3.6 format strings and Python 3.14 template strings."""
|
|
4649
4651
|
string, = tokens
|
|
4650
4652
|
|
|
4651
4653
|
# strip raw r
|
|
@@ -4662,7 +4664,7 @@ __annotations__["{name}"] = {annotation}
|
|
|
4662
4664
|
|
|
4663
4665
|
# warn if there are no exprs
|
|
4664
4666
|
if not exprs:
|
|
4665
|
-
self.
|
|
4667
|
+
self.strict_qa_error(("t" if is_t else "f") + "-string with no expressions", original, loc)
|
|
4666
4668
|
|
|
4667
4669
|
# handle Python 3.8 f string = specifier
|
|
4668
4670
|
for i, expr in enumerate(exprs):
|
|
@@ -4683,22 +4685,39 @@ __annotations__["{name}"] = {annotation}
|
|
|
4683
4685
|
raise CoconutDeferredSyntaxError("illegal complex expression in format string: " + co_expr, loc)
|
|
4684
4686
|
compiled_exprs.append(py_expr)
|
|
4685
4687
|
|
|
4686
|
-
#
|
|
4687
|
-
|
|
4688
|
-
# supported on 3.12+, so we should only use the literal syntax there)
|
|
4689
|
-
if self.target_info >= (3, 12):
|
|
4688
|
+
# handle t-strings
|
|
4689
|
+
if is_t:
|
|
4690
4690
|
new_text = interleaved_join(string_parts, compiled_exprs)
|
|
4691
|
-
|
|
4691
|
+
if self.target_info >= (3, 14):
|
|
4692
|
+
# Native t-string syntax
|
|
4693
|
+
return "t" + ("r" if raw else "") + self.wrap_str(new_text, strchar)
|
|
4694
|
+
else:
|
|
4695
|
+
# Use tstr backport - tstr.t() uses caller's frame for variable lookup
|
|
4696
|
+
# Will raise runtime error if tstr not available (works with universal target)
|
|
4697
|
+
template_str = ("r" if raw else "") + self.wrap_str(new_text, strchar)
|
|
4698
|
+
return "_coconut.tstr.t(" + template_str + ")" + self.type_ignore_comment()
|
|
4692
4699
|
|
|
4693
4700
|
else:
|
|
4694
|
-
|
|
4695
|
-
|
|
4701
|
+
# reconstitute string
|
|
4702
|
+
# (though f strings are supported on 3.6+, nested strings with the same strchars are only
|
|
4703
|
+
# supported on 3.12+, so we should only use the literal syntax there)
|
|
4704
|
+
if self.target_info >= (3, 12):
|
|
4705
|
+
new_text = interleaved_join(string_parts, compiled_exprs)
|
|
4706
|
+
return "f" + ("r" if raw else "") + self.wrap_str(new_text, strchar)
|
|
4696
4707
|
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4708
|
+
else:
|
|
4709
|
+
names = [format_var + "_" + str(i) for i in range(len(compiled_exprs))]
|
|
4710
|
+
new_text = interleaved_join(string_parts, names)
|
|
4711
|
+
|
|
4712
|
+
# generate format call
|
|
4713
|
+
return ("r" if raw else "") + self.wrap_str(new_text, strchar) + ".format(" + ", ".join(
|
|
4714
|
+
name + "=(" + self.wrap_passthrough(expr) + ")"
|
|
4715
|
+
for name, expr in zip(names, compiled_exprs)
|
|
4716
|
+
) + ")"
|
|
4717
|
+
|
|
4718
|
+
def t_string_handle(self, original, loc, tokens):
|
|
4719
|
+
"""Process Python 3.14 template strings."""
|
|
4720
|
+
return self.f_string_handle(original, loc, tokens, is_t=True)
|
|
4702
4721
|
|
|
4703
4722
|
def decorators_handle(self, loc, tokens):
|
|
4704
4723
|
"""Process decorators."""
|
|
@@ -4905,7 +4924,7 @@ async with {iter_item} as {temp_var}:
|
|
|
4905
4924
|
return tokens[0]
|
|
4906
4925
|
else:
|
|
4907
4926
|
if not allow_silent_concat:
|
|
4908
|
-
self.
|
|
4927
|
+
self.strict_qa_error("found implicit string concatenation (use explicit '+' instead)", original, loc)
|
|
4909
4928
|
if any(s.endswith(")") for s in tokens): # has .format() calls
|
|
4910
4929
|
# parens are necessary for string_atom_handle
|
|
4911
4930
|
return "(" + " + ".join(tokens) + ")"
|
|
@@ -5059,7 +5078,7 @@ class {protocol_var}({tokens}, _coconut.typing.Protocol): pass
|
|
|
5059
5078
|
if bound_op is not None:
|
|
5060
5079
|
self.internal_assert(bound_op_type in ("bound", "constraint"), original, loc, "invalid type_param bound_op", bound_op)
|
|
5061
5080
|
if bound_op == "<=":
|
|
5062
|
-
self.
|
|
5081
|
+
self.strict_qa_error(
|
|
5063
5082
|
"use of " + repr(bound_op) + " as a type parameter " + bound_op_type + " declaration operator is deprecated (Coconut style is to use '<:' for bounds and ':' for constaints)",
|
|
5064
5083
|
original,
|
|
5065
5084
|
loc,
|
|
@@ -5334,7 +5353,7 @@ class {protocol_var}({tokens}, _coconut.typing.Protocol): pass
|
|
|
5334
5353
|
and not (classname or expr_setname)
|
|
5335
5354
|
and name in all_builtins
|
|
5336
5355
|
):
|
|
5337
|
-
self.
|
|
5356
|
+
self.strict_qa_error(
|
|
5338
5357
|
"assignment shadows builtin '{name}' (use explicit '\\{name}' syntax when purposefully assigning to builtin names)".format(name=name),
|
|
5339
5358
|
original,
|
|
5340
5359
|
loc,
|
|
@@ -5422,7 +5441,6 @@ class {protocol_var}({tokens}, _coconut.typing.Protocol): pass
|
|
|
5422
5441
|
loc,
|
|
5423
5442
|
tokens,
|
|
5424
5443
|
only_warn=True,
|
|
5425
|
-
always_warn=True,
|
|
5426
5444
|
)
|
|
5427
5445
|
|
|
5428
5446
|
def check_py(self, version, name, original, loc, tokens):
|
{coconut_develop-3.1.2.post0.dev9 → coconut_develop-3.1.2.post0.dev11}/coconut/compiler/grammar.py
RENAMED
|
@@ -929,11 +929,13 @@ class Grammar(object):
|
|
|
929
929
|
|
|
930
930
|
u_string = Forward()
|
|
931
931
|
f_string = Forward()
|
|
932
|
+
t_string = Forward()
|
|
932
933
|
|
|
933
934
|
bit_b = caseless_literal("b")
|
|
934
935
|
raw_r = caseless_literal("r")
|
|
935
936
|
unicode_u = caseless_literal("u", suppress=True)
|
|
936
937
|
format_f = caseless_literal("f", suppress=True)
|
|
938
|
+
template_t = caseless_literal("t", suppress=True)
|
|
937
939
|
|
|
938
940
|
string = combine(Optional(raw_r) + string_item)
|
|
939
941
|
# Python 2 only supports br"..." not rb"..."
|
|
@@ -941,8 +943,9 @@ class Grammar(object):
|
|
|
941
943
|
# ur"..."/ru"..." strings are not suppored in Python 3
|
|
942
944
|
u_string_ref = combine(unicode_u + string_item)
|
|
943
945
|
f_string_tokens = combine((format_f + Optional(raw_r) | raw_r + format_f) + string_item)
|
|
946
|
+
t_string_tokens = combine((template_t + Optional(raw_r) | raw_r + template_t) + string_item)
|
|
944
947
|
nonbf_string = string | u_string
|
|
945
|
-
nonb_string = nonbf_string | f_string
|
|
948
|
+
nonb_string = nonbf_string | f_string | t_string
|
|
946
949
|
any_string = nonb_string | b_string
|
|
947
950
|
moduledoc = any_string + newline
|
|
948
951
|
docstring = condense(moduledoc)
|
|
@@ -2862,7 +2865,7 @@ class Grammar(object):
|
|
|
2862
2865
|
| fixto(end_of_line, "misplaced newline (maybe missing ':')")
|
|
2863
2866
|
)
|
|
2864
2867
|
|
|
2865
|
-
start_f_str_regex = compile_regex(r"\br?
|
|
2868
|
+
start_f_str_regex = compile_regex(r"\br?[ft]r?$")
|
|
2866
2869
|
start_f_str_regex_len = 4
|
|
2867
2870
|
|
|
2868
2871
|
end_f_str_expr = StartOfStrGrammar(combine(rbrace | colon | bang).leaveWhitespace())
|