Skip to content

Commit 8e66108

Browse files
committed
Fix py2
1 parent e62b4a8 commit 8e66108

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

DOCS.md

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ depth: 1
122122

123123
```
124124
coconut [-h] [--and source [dest ...]] [-v] [-t version] [-i] [-p] [-a] [-l]
125-
[--no-line-numbers] [-k] [-w] [-r] [-n] [-d] [-q] [-s] [--no-tco] [--no-wrap-types]
126-
[-c code] [-j processes] [-f] [--minify] [--jupyter ...] [--mypy ...] [--pyright]
127-
[--argv ...] [--tutorial] [--docs] [--style name] [--vi-mode]
125+
[--no-line-numbers] [-k] [-w] [-r] [-n] [-d] [-q] [-s] [--pure] [--no-tco]
126+
[--no-wrap-types] [-c code] [-j processes] [-f] [--minify] [--jupyter ...]
127+
[--mypy ...] [--pyright] [--argv ...] [--tutorial] [--docs] [--style name] [--vi-mode]
128128
[--recursion-limit limit] [--stack-size kbs] [--fail-fast] [--no-cache]
129129
[--site-install] [--site-uninstall] [--verbose] [--trace] [--profile]
130130
[source] [dest]
@@ -145,8 +145,7 @@ dest destination directory for compiled files (defaults to
145145
--and source [dest ...]
146146
add an additional source/dest pair to compile (dest is optional)
147147
-v, -V, --version print Coconut and Python version information
148-
-t version, --target version
149-
specify target Python version (defaults to universal)
148+
-t, --target version specify target Python version (defaults to universal)
150149
-i, --interact force the interpreter to start (otherwise starts if no other command is
151150
given) (implies --run)
152151
-p, --package compile source as part of a package (defaults to only if source is a
@@ -166,48 +165,45 @@ dest destination directory for compiled files (defaults to
166165
-n, --no-write, --nowrite
167166
disable writing compiled Python
168167
-d, --display print compiled Python
169-
-q, --quiet suppress all informational output (combine with --display to write
170-
runnable code to stdout)
168+
-q, --quiet suppress all informational output (combine with --display to write runnable
169+
code to stdout)
171170
-s, --strict enforce code cleanliness standards
171+
--pure enforce functional programming norms
172172
--no-tco, --notco disable tail call optimization
173173
--no-wrap-types, --nowraptypes
174174
disable wrapping type annotations in strings and turn off 'from __future__
175175
import annotations' behavior
176-
-c code, --code code run Coconut passed in as a string (can also be piped into stdin)
177-
-j processes, --jobs processes
178-
number of additional processes to use (defaults to 'sys') (0 is no
179-
additional processes; 'sys' uses machine default)
180-
-f, --force force re-compilation even when source code and compilation parameters
181-
haven't changed
176+
-c, --code code run Coconut passed in as a string (can also be piped into stdin)
177+
-j, --jobs processes number of additional processes to use (defaults to 'sys') (0 is no additional
178+
processes; 'sys' uses machine default)
179+
-f, --force force re-compilation even when source code and compilation parameters haven't
180+
changed
182181
--minify reduce size of compiled Python
183-
--jupyter ..., --ipython ...
182+
--jupyter, --ipython ...
184183
run Jupyter/IPython with Coconut as the kernel (remaining args passed to
185184
Jupyter)
186185
--mypy ... run MyPy on compiled Python (remaining args passed to MyPy) (implies
187186
--package --line-numbers)
188187
--pyright run Pyright on compiled Python (implies --package)
189-
--argv ..., --args ...
190-
set sys.argv to source plus remaining args for use in the Coconut script
188+
--argv, --args ... set sys.argv to source plus remaining args for use in the Coconut script
191189
being run
192190
--tutorial open Coconut's tutorial in the default web browser
193191
--docs, --documentation
194192
open Coconut's documentation in the default web browser
195-
--style name set Pygments syntax highlighting style (or 'list' to list styles)
196-
(defaults to COCONUT_STYLE environment variable if it exists, otherwise
197-
'default')
198-
--vi-mode, --vimode enable vi mode in the interpreter (currently set to False) (can be
199-
modified by setting COCONUT_VI_MODE environment variable)
200-
--recursion-limit limit, --recursionlimit limit
201-
set maximum recursion depth in compiler (defaults to 1920) (when
202-
increasing --recursion-limit, you may also need to increase --stack-size;
203-
setting them to approximately equal values is recommended)
204-
--stack-size kbs, --stacksize kbs
205-
run the compiler in a separate thread with the given stack size in
206-
kilobytes
207-
--fail-fast causes the compiler to fail immediately upon encountering a compilation
208-
error rather than attempting to continue compiling other files
209-
--no-cache disables use of Coconut's incremental parsing cache (caches previous
210-
parses to improve recompilation performance for slightly modified files)
193+
--style name set Pygments syntax highlighting style (or 'list' to list styles) (defaults
194+
to COCONUT_STYLE environment variable if it exists, otherwise 'default')
195+
--vi-mode, --vimode enable vi mode in the interpreter (currently set to False) (can be modified
196+
by setting COCONUT_VI_MODE environment variable)
197+
--recursion-limit, --recursionlimit limit
198+
set maximum recursion depth in compiler (defaults to 1920) (when increasing
199+
--recursion-limit, you may also need to increase --stack-size; setting them
200+
to approximately equal values is recommended)
201+
--stack-size, --stacksize kbs
202+
run the compiler in a separate thread with the given stack size in kilobytes
203+
--fail-fast causes the compiler to fail immediately upon encountering a compilation error
204+
rather than attempting to continue compiling other files
205+
--no-cache disables use of Coconut's incremental parsing cache (caches previous parses
206+
to improve recompilation performance for slightly modified files)
211207
--site-install, --siteinstall
212208
set up coconut.api to be imported on Python start
213209
--site-uninstall, --siteuninstall

coconut/tests/src/extras.coco

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,8 @@ class A:
571571
def f():
572572
global x
573573
""".strip()), CoconutStyleError, err_has="pure")
574+
# nonlocal requires target="3" since it's Python 3 only
575+
setup(line_numbers=False, strict=True, pure=True, target="3")
574576
assert_raises(-> parse("""
575577
def f():
576578
x = 1
@@ -596,6 +598,8 @@ class Foo(object): # NOQA
596598
def f():
597599
global x # NOQA
598600
""".strip())
601+
# nonlocal requires target="3" since it's Python 3 only
602+
setup(line_numbers=False, strict=True, pure=True, target="3")
599603
parse("""
600604
def f():
601605
x = 1

0 commit comments

Comments
 (0)