coconut-develop 3.0.4.post0.dev19__tar.gz → 3.0.4.post0.dev20__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. coconut-develop-3.0.4.post0.dev20/PKG-INFO +140 -0
  2. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/compiler/templates/header.py_template +1 -1
  3. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/icoconut/coconut/kernel.json +3 -3
  4. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/root.py +1 -1
  5. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/terminal.py +11 -5
  6. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/util.py +5 -4
  7. coconut-develop-3.0.4.post0.dev19/PKG-INFO +0 -140
  8. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/CONTRIBUTING.md +0 -0
  9. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/DOCS.md +0 -0
  10. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/FAQ.md +0 -0
  11. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/HELP.md +0 -0
  12. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/LICENSE.txt +0 -0
  13. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/MANIFEST.in +0 -0
  14. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/README.rst +0 -0
  15. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/__coconut__/__init__.py +0 -0
  16. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/__coconut__/__init__.pyi +0 -0
  17. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/__coconut__/py.typed +0 -0
  18. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/_coconut/__init__.py +0 -0
  19. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/_coconut/__init__.pyi +0 -0
  20. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/_coconut/py.typed +0 -0
  21. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/__coconut__.py +0 -0
  22. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/__coconut__.pyi +0 -0
  23. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/__init__.py +0 -0
  24. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/__init__.pyi +0 -0
  25. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/__main__.py +0 -0
  26. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/_pyparsing.py +0 -0
  27. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/api.py +0 -0
  28. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/api.pyi +0 -0
  29. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/command/__init__.py +0 -0
  30. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/command/__init__.pyi +0 -0
  31. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/command/cli.py +0 -0
  32. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/command/command.py +0 -0
  33. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/command/command.pyi +0 -0
  34. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/command/mypy.py +0 -0
  35. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/command/resources/zcoconut.pth +0 -0
  36. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/command/util.py +0 -0
  37. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/command/watch.py +0 -0
  38. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/compiler/__init__.py +0 -0
  39. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/compiler/compiler.py +0 -0
  40. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/compiler/grammar.py +0 -0
  41. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/compiler/header.py +0 -0
  42. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/compiler/matching.py +0 -0
  43. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/compiler/util.py +0 -0
  44. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/constants.py +0 -0
  45. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/convenience.py +0 -0
  46. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/convenience.pyi +0 -0
  47. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/exceptions.py +0 -0
  48. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/highlighter.py +0 -0
  49. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/icoconut/__init__.py +0 -0
  50. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/icoconut/__main__.py +0 -0
  51. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/icoconut/coconut_py/kernel.json +0 -0
  52. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/icoconut/coconut_py2/kernel.json +0 -0
  53. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/icoconut/coconut_py3/kernel.json +0 -0
  54. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/icoconut/embed.py +0 -0
  55. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/icoconut/root.py +0 -0
  56. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/integrations.py +0 -0
  57. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/main.py +0 -0
  58. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/py.typed +0 -0
  59. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/requirements.py +0 -0
  60. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/tests/__init__.py +0 -0
  61. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/tests/__main__.py +0 -0
  62. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/tests/constants_test.py +0 -0
  63. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/tests/main_test.py +0 -0
  64. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/tests/src/cocotest/agnostic/__init__.coco +0 -0
  65. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/tests/src/cocotest/agnostic/__main__.coco +0 -0
  66. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/tests/src/cocotest/agnostic/main.coco +0 -0
  67. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/tests/src/cocotest/agnostic/primary_1.coco +0 -0
  68. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/tests/src/cocotest/agnostic/primary_2.coco +0 -0
  69. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/tests/src/cocotest/agnostic/specific.coco +0 -0
  70. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/tests/src/cocotest/agnostic/suite.coco +0 -0
  71. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/tests/src/cocotest/agnostic/tutorial.coco +0 -0
  72. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/tests/src/cocotest/agnostic/util.coco +0 -0
  73. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/tests/src/cocotest/non_strict/non_strict_test.coco +0 -0
  74. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/tests/src/cocotest/target_2/py2_test.coco +0 -0
  75. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/tests/src/cocotest/target_3/py3_test.coco +0 -0
  76. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/tests/src/cocotest/target_311/py311_test.coco +0 -0
  77. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/tests/src/cocotest/target_35/py35_test.coco +0 -0
  78. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/tests/src/cocotest/target_36/py36_test.coco +0 -0
  79. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/tests/src/cocotest/target_38/py38_test.coco +0 -0
  80. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/tests/src/cocotest/target_sys/target_sys_test.coco +0 -0
  81. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/tests/src/extras.coco +0 -0
  82. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/tests/src/importable.coco +0 -0
  83. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/tests/src/runnable.coco +0 -0
  84. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut/tests/src/runner.coco +0 -0
  85. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/coconut_develop.egg-info/SOURCES.txt +0 -0
  86. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/conf.py +0 -0
  87. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/pyproject.toml +0 -0
  88. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/setup.cfg +0 -0
  89. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/setup.py +0 -0
  90. {coconut-develop-3.0.4.post0.dev19 → coconut-develop-3.0.4.post0.dev20}/xontrib/coconut.py +0 -0
@@ -0,0 +1,140 @@
1
+ Metadata-Version: 2.1
2
+ Name: coconut-develop
3
+ Version: 3.0.4.post0.dev20
4
+ Summary: Simple, elegant, Pythonic functional programming.
5
+ Home-page: http://coconut-lang.org
6
+ Author: Evan Hubinger
7
+ Author-email: evanjhub@gmail.com
8
+ License: Apache 2.0
9
+ Description: |logo| Coconut
10
+ ==============
11
+
12
+ ..
13
+ <insert toctree here>
14
+
15
+ .. |logo| image:: https://github.com/evhub/coconut/raw/gh-pages/favicon-32x32.png
16
+
17
+ .. image:: https://opencollective.com/coconut/backers/badge.svg
18
+ :alt: Backers on Open Collective
19
+ :target: #backers
20
+ .. image:: https://opencollective.com/coconut/sponsors/badge.svg
21
+ :alt: Sponsors on Open Collective
22
+ :target: #sponsors
23
+ .. image:: https://badges.gitter.im/evhub/coconut.svg
24
+ :alt: Join the chat at https://gitter.im/evhub/coconut
25
+ :target: https://gitter.im/evhub/coconut?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
26
+
27
+ Coconut (`coconut-lang.org`__) is a variant of Python_ that **adds on top of Python syntax** new features for simple, elegant, Pythonic **functional programming**.
28
+
29
+ __ Coconut_
30
+ .. _Coconut: http://coconut-lang.org/
31
+
32
+ Coconut is developed on GitHub_ and hosted on PyPI_. Installing Coconut is as easy as opening a command prompt and entering::
33
+
34
+ pip install coconut
35
+
36
+ To help you get started, check out these links for more information about Coconut:
37
+
38
+ - Tutorial_: If you're new to Coconut, a good place to start is Coconut's **tutorial**.
39
+ - Documentation_: If you're looking for info about a specific feature, check out Coconut's **documentation**.
40
+ - `Online Interpreter`_: If you want to try Coconut in your browser, check out Coconut's **online interpreter**.
41
+ - FAQ_: If you have general questions about Coconut—like who Coconut is built for and whether or not you should use it—Coconut's frequently asked questions are often the best place to start.
42
+ - `Create a New Issue <https://github.com/evhub/coconut/issues/new>`_: If you're having a problem with Coconut, creating a new issue detailing the problem will allow it to be addressed as soon as possible.
43
+ - Gitter_: For any questions, concerns, or comments about anything Coconut-related, ask around at Coconut's Gitter, a GitHub-integrated chat room for Coconut developers.
44
+ - Releases_: Want to know what's been added in recent Coconut versions? Check out the release log for all the new features and fixes.
45
+
46
+ .. _Python: https://www.python.org/
47
+ .. _PyPI: https://pypi.python.org/pypi/coconut
48
+ .. _Tutorial: http://coconut.readthedocs.io/en/latest/HELP.html
49
+ .. _Documentation: http://coconut.readthedocs.io/en/latest/DOCS.html
50
+ .. _`Online Interpreter`: https://cs121-team-panda.github.io/coconut-interpreter
51
+ .. _FAQ: http://coconut.readthedocs.io/en/latest/FAQ.html
52
+ .. _GitHub: https://github.com/evhub/coconut
53
+ .. _Gitter: https://gitter.im/evhub/coconut
54
+ .. _Releases: https://github.com/evhub/coconut/releases
55
+
56
+ Credits
57
+ +++++++
58
+
59
+ Contributors
60
+ ------------
61
+
62
+ This project exists thanks to all the people who contribute! `Become a contributor`__.
63
+
64
+ .. image:: https://opencollective.com/coconut/contributors.svg?width=890&button=false
65
+ :target: https://github.com/evhub/coconut/graphs/contributors
66
+
67
+ __ Contributor_
68
+ .. _Contributor: http://coconut.readthedocs.io/en/develop/CONTRIBUTING.html
69
+
70
+ Backers
71
+ -------
72
+
73
+ Thank you to all our backers! `Become a backer`__.
74
+
75
+ .. image:: https://opencollective.com/coconut/backers.svg?width=890
76
+ :target: https://opencollective.com/coconut#backers
77
+
78
+ __ Backer_
79
+ .. _Backer: https://opencollective.com/coconut#backer
80
+
81
+ Sponsors
82
+ --------
83
+
84
+ Support Coconut by becoming a sponsor. Your logo will show up here with a link to your website. `Become a sponsor`__.
85
+
86
+ .. image:: https://opencollective.com/XX/sponsor/0/avatar.svg
87
+ :target: https://opencollective.com/coconut/sponsor/0/website
88
+
89
+ __ Sponsor_
90
+ .. _Sponsor: https://opencollective.com/coconut#sponsor
91
+
92
+ Keywords: functional,programming,language,compiler,pattern,pattern-matching,algebraic,data type,data types,lambda,lambdas,lazy,evaluation,lazy list,lazy lists,tail,recursion,call,recursive,recursive_iterator,infix,function,composition,compose,partial,application,currying,curry,pipeline,pipe,unicode,operator,operators,frozenset,literal,syntax,destructuring,assignment,fold,datamaker,prepattern,iterator,generator,none,coalesce,coalescing,statement,lru_cache,memoization,backport,typing,embed,PEP 622,overrides,islice,itertools,functools,TYPE_CHECKING,Expected,breakpoint,help,reduce,takewhile,dropwhile,tee,count,makedata,consume,process_map,thread_map,addpattern,recursive_generator,fmap,starmap,reiterable,scan,groupsof,memoize,zip_longest,override,flatten,ident,call,safe_call,flip,const,lift,lift_apart,all_equal,collectby,mapreduce,multi_enumerate,cartesian_product,multiset,cycle,windowsof,and_then,and_then_await,async_map,py_chr,py_dict,py_hex,py_input,py_int,py_map,py_object,py_oct,py_open,py_print,py_range,py_str,py_super,py_zip,py_filter,py_reversed,py_enumerate,py_raw_input,py_xrange,py_repr,py_breakpoint,_namedtuple_of,reveal_type,reveal_locals,MatchError,__fmap__,__iter_getitem__,data,match,case,cases,where,addpattern,then,operator,type,copyclosure,λ
93
+ Platform: UNKNOWN
94
+ Classifier: Development Status :: 5 - Production/Stable
95
+ Classifier: License :: OSI Approved :: Apache Software License
96
+ Classifier: Intended Audience :: Developers
97
+ Classifier: Topic :: Software Development
98
+ Classifier: Topic :: Software Development :: Code Generators
99
+ Classifier: Topic :: Software Development :: Compilers
100
+ Classifier: Topic :: Software Development :: Interpreters
101
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
102
+ Classifier: Topic :: Utilities
103
+ Classifier: Environment :: Console
104
+ Classifier: Operating System :: OS Independent
105
+ Classifier: Programming Language :: Python
106
+ Classifier: Programming Language :: Python :: 2
107
+ Classifier: Programming Language :: Python :: 2.6
108
+ Classifier: Programming Language :: Python :: 2.7
109
+ Classifier: Programming Language :: Python :: 3
110
+ Classifier: Programming Language :: Python :: 3.2
111
+ Classifier: Programming Language :: Python :: 3.3
112
+ Classifier: Programming Language :: Python :: 3.4
113
+ Classifier: Programming Language :: Python :: 3.5
114
+ Classifier: Programming Language :: Python :: 3.6
115
+ Classifier: Programming Language :: Python :: 3.7
116
+ Classifier: Programming Language :: Python :: 3.8
117
+ Classifier: Programming Language :: Python :: 3.9
118
+ Classifier: Programming Language :: Python :: 3.10
119
+ Classifier: Programming Language :: Python :: 3.11
120
+ Classifier: Programming Language :: Python :: 3.12
121
+ Classifier: Programming Language :: Other
122
+ Classifier: Programming Language :: Other Scripting Engines
123
+ Classifier: Programming Language :: Python :: Implementation :: CPython
124
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
125
+ Classifier: Framework :: IPython
126
+ Classifier: Framework :: Jupyter
127
+ Classifier: Typing :: Typed
128
+ Provides-Extra: ipython
129
+ Provides-Extra: dev
130
+ Provides-Extra: kernel
131
+ Provides-Extra: watch
132
+ Provides-Extra: docs
133
+ Provides-Extra: jupyterlab
134
+ Provides-Extra: xonsh
135
+ Provides-Extra: mypy
136
+ Provides-Extra: jupyter
137
+ Provides-Extra: all
138
+ Provides-Extra: jupytext
139
+ Provides-Extra: numpy
140
+ Provides-Extra: tests
@@ -2094,7 +2094,7 @@ def _coconut_call_or_coefficient(func, *args):
2094
2094
  if _coconut.callable(func):
2095
2095
  return func(*args)
2096
2096
  if not _coconut.isinstance(func, (_coconut.int, _coconut.float, _coconut.complex)) and _coconut_get_base_module(func) not in _coconut.numpy_modules:
2097
- raise _coconut.TypeError("implicit function application and coefficient syntax only supported for Callable, int, float, complex, and numpy objects")
2097
+ raise _coconut.TypeError("first object in implicit function application and coefficient syntax must be Callable, int, float, complex, or numpy")
2098
2098
  func = func
2099
2099
  for x in args:
2100
2100
  func = func * x{COMMENT.no_times_equals_to_avoid_modification}
@@ -1,11 +1,11 @@
1
1
  {
2
+ "display_name": "Coconut",
3
+ "language": "coconut",
2
4
  "argv": [
3
5
  "python",
4
6
  "-m",
5
7
  "coconut.icoconut",
6
8
  "-f",
7
9
  "{connection_file}"
8
- ],
9
- "display_name": "Coconut",
10
- "language": "coconut"
10
+ ]
11
11
  }
@@ -26,7 +26,7 @@ import sys as _coconut_sys
26
26
  VERSION = "3.0.4"
27
27
  VERSION_NAME = None
28
28
  # False for release, int >= 1 for develop
29
- DEVELOP = 19
29
+ DEVELOP = 20
30
30
  ALPHA = False # for pre releases rather than post releases
31
31
 
32
32
  assert DEVELOP is False or DEVELOP >= 1, "DEVELOP must be False or an int >= 1"
@@ -183,6 +183,16 @@ class LoggingStringIO(StringIO):
183
183
  sys.stdout = old_stdout
184
184
 
185
185
 
186
+ def should_use_color(file=None):
187
+ """Determine if colors should be used for the given file object."""
188
+ use_color = get_bool_env_var(use_color_env_var, default=None)
189
+ if use_color is not None:
190
+ return use_color
191
+ if get_bool_env_var("CLICOLOR_FORCE") or get_bool_env_var("FORCE_COLOR"):
192
+ return True
193
+ return file is not None and not isatty(file)
194
+
195
+
186
196
  # -----------------------------------------------------------------------------------------------------------------------
187
197
  # LOGGER:
188
198
  # -----------------------------------------------------------------------------------------------------------------------
@@ -210,11 +220,7 @@ class Logger(object):
210
220
  @classmethod
211
221
  def enable_colors(cls, file=None):
212
222
  """Attempt to enable CLI colors."""
213
- use_color = get_bool_env_var(use_color_env_var, default=None)
214
- if (
215
- use_color is False
216
- or use_color is None and file is not None and not isatty(file)
217
- ):
223
+ if not should_use_color(file):
218
224
  return False
219
225
  if not cls.colors_enabled:
220
226
  # necessary to resolve https://bugs.python.org/issue40134
@@ -8,7 +8,7 @@
8
8
  """
9
9
  Author: Evan Hubinger
10
10
  License: Apache 2.0
11
- Description: Installer for the Coconut Jupyter kernel.
11
+ Description: Base Coconut utilities.
12
12
  """
13
13
 
14
14
  # -----------------------------------------------------------------------------------------------------------------------
@@ -331,16 +331,17 @@ def replace_all(inputstr, all_to_replace, replace_to):
331
331
  return inputstr
332
332
 
333
333
 
334
- def highlight(code):
334
+ def highlight(code, force=False):
335
335
  """Attempt to highlight Coconut code for the terminal."""
336
336
  from coconut.terminal import logger # hide to remove circular deps
337
- if logger.enable_colors(sys.stdout) and logger.enable_colors(sys.stderr):
337
+ if force or logger.enable_colors(sys.stdout) and logger.enable_colors(sys.stderr):
338
338
  try:
339
339
  from coconut.highlighter import highlight_coconut_for_terminal
340
340
  except ImportError:
341
341
  logger.log_exc()
342
342
  else:
343
- return highlight_coconut_for_terminal(code)
343
+ code_base, code_white = split_trailing_whitespace(code)
344
+ return highlight_coconut_for_terminal(code_base).rstrip() + code_white
344
345
  return code
345
346
 
346
347
 
@@ -1,140 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: coconut-develop
3
- Version: 3.0.4.post0.dev19
4
- Summary: Simple, elegant, Pythonic functional programming.
5
- Home-page: http://coconut-lang.org
6
- Author: Evan Hubinger
7
- Author-email: evanjhub@gmail.com
8
- License: Apache 2.0
9
- Keywords: functional,programming,language,compiler,pattern,pattern-matching,algebraic,data type,data types,lambda,lambdas,lazy,evaluation,lazy list,lazy lists,tail,recursion,call,recursive,recursive_iterator,infix,function,composition,compose,partial,application,currying,curry,pipeline,pipe,unicode,operator,operators,frozenset,literal,syntax,destructuring,assignment,fold,datamaker,prepattern,iterator,generator,none,coalesce,coalescing,statement,lru_cache,memoization,backport,typing,embed,PEP 622,overrides,islice,itertools,functools,TYPE_CHECKING,Expected,breakpoint,help,reduce,takewhile,dropwhile,tee,count,makedata,consume,process_map,thread_map,addpattern,recursive_generator,fmap,starmap,reiterable,scan,groupsof,memoize,zip_longest,override,flatten,ident,call,safe_call,flip,const,lift,lift_apart,all_equal,collectby,mapreduce,multi_enumerate,cartesian_product,multiset,cycle,windowsof,and_then,and_then_await,async_map,py_chr,py_dict,py_hex,py_input,py_int,py_map,py_object,py_oct,py_open,py_print,py_range,py_str,py_super,py_zip,py_filter,py_reversed,py_enumerate,py_raw_input,py_xrange,py_repr,py_breakpoint,_namedtuple_of,reveal_type,reveal_locals,MatchError,__fmap__,__iter_getitem__,data,match,case,cases,where,addpattern,then,operator,type,copyclosure,λ
10
- Classifier: Development Status :: 5 - Production/Stable
11
- Classifier: License :: OSI Approved :: Apache Software License
12
- Classifier: Intended Audience :: Developers
13
- Classifier: Topic :: Software Development
14
- Classifier: Topic :: Software Development :: Code Generators
15
- Classifier: Topic :: Software Development :: Compilers
16
- Classifier: Topic :: Software Development :: Interpreters
17
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
- Classifier: Topic :: Utilities
19
- Classifier: Environment :: Console
20
- Classifier: Operating System :: OS Independent
21
- Classifier: Programming Language :: Python
22
- Classifier: Programming Language :: Python :: 2
23
- Classifier: Programming Language :: Python :: 2.6
24
- Classifier: Programming Language :: Python :: 2.7
25
- Classifier: Programming Language :: Python :: 3
26
- Classifier: Programming Language :: Python :: 3.2
27
- Classifier: Programming Language :: Python :: 3.3
28
- Classifier: Programming Language :: Python :: 3.4
29
- Classifier: Programming Language :: Python :: 3.5
30
- Classifier: Programming Language :: Python :: 3.6
31
- Classifier: Programming Language :: Python :: 3.7
32
- Classifier: Programming Language :: Python :: 3.8
33
- Classifier: Programming Language :: Python :: 3.9
34
- Classifier: Programming Language :: Python :: 3.10
35
- Classifier: Programming Language :: Python :: 3.11
36
- Classifier: Programming Language :: Python :: 3.12
37
- Classifier: Programming Language :: Other
38
- Classifier: Programming Language :: Other Scripting Engines
39
- Classifier: Programming Language :: Python :: Implementation :: CPython
40
- Classifier: Programming Language :: Python :: Implementation :: PyPy
41
- Classifier: Framework :: IPython
42
- Classifier: Framework :: Jupyter
43
- Classifier: Typing :: Typed
44
- Provides-Extra: kernel
45
- Provides-Extra: watch
46
- Provides-Extra: mypy
47
- Provides-Extra: xonsh
48
- Provides-Extra: numpy
49
- Provides-Extra: jupyter
50
- Provides-Extra: jupyterlab
51
- Provides-Extra: jupytext
52
- Provides-Extra: all
53
- Provides-Extra: ipython
54
- Provides-Extra: docs
55
- Provides-Extra: tests
56
- Provides-Extra: dev
57
- License-File: LICENSE.txt
58
-
59
- |logo| Coconut
60
- ==============
61
-
62
- ..
63
- <insert toctree here>
64
-
65
- .. |logo| image:: https://github.com/evhub/coconut/raw/gh-pages/favicon-32x32.png
66
-
67
- .. image:: https://opencollective.com/coconut/backers/badge.svg
68
- :alt: Backers on Open Collective
69
- :target: #backers
70
- .. image:: https://opencollective.com/coconut/sponsors/badge.svg
71
- :alt: Sponsors on Open Collective
72
- :target: #sponsors
73
- .. image:: https://badges.gitter.im/evhub/coconut.svg
74
- :alt: Join the chat at https://gitter.im/evhub/coconut
75
- :target: https://gitter.im/evhub/coconut?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
76
-
77
- Coconut (`coconut-lang.org`__) is a variant of Python_ that **adds on top of Python syntax** new features for simple, elegant, Pythonic **functional programming**.
78
-
79
- __ Coconut_
80
- .. _Coconut: http://coconut-lang.org/
81
-
82
- Coconut is developed on GitHub_ and hosted on PyPI_. Installing Coconut is as easy as opening a command prompt and entering::
83
-
84
- pip install coconut
85
-
86
- To help you get started, check out these links for more information about Coconut:
87
-
88
- - Tutorial_: If you're new to Coconut, a good place to start is Coconut's **tutorial**.
89
- - Documentation_: If you're looking for info about a specific feature, check out Coconut's **documentation**.
90
- - `Online Interpreter`_: If you want to try Coconut in your browser, check out Coconut's **online interpreter**.
91
- - FAQ_: If you have general questions about Coconut—like who Coconut is built for and whether or not you should use it—Coconut's frequently asked questions are often the best place to start.
92
- - `Create a New Issue <https://github.com/evhub/coconut/issues/new>`_: If you're having a problem with Coconut, creating a new issue detailing the problem will allow it to be addressed as soon as possible.
93
- - Gitter_: For any questions, concerns, or comments about anything Coconut-related, ask around at Coconut's Gitter, a GitHub-integrated chat room for Coconut developers.
94
- - Releases_: Want to know what's been added in recent Coconut versions? Check out the release log for all the new features and fixes.
95
-
96
- .. _Python: https://www.python.org/
97
- .. _PyPI: https://pypi.python.org/pypi/coconut
98
- .. _Tutorial: http://coconut.readthedocs.io/en/latest/HELP.html
99
- .. _Documentation: http://coconut.readthedocs.io/en/latest/DOCS.html
100
- .. _`Online Interpreter`: https://cs121-team-panda.github.io/coconut-interpreter
101
- .. _FAQ: http://coconut.readthedocs.io/en/latest/FAQ.html
102
- .. _GitHub: https://github.com/evhub/coconut
103
- .. _Gitter: https://gitter.im/evhub/coconut
104
- .. _Releases: https://github.com/evhub/coconut/releases
105
-
106
- Credits
107
- +++++++
108
-
109
- Contributors
110
- ------------
111
-
112
- This project exists thanks to all the people who contribute! `Become a contributor`__.
113
-
114
- .. image:: https://opencollective.com/coconut/contributors.svg?width=890&button=false
115
- :target: https://github.com/evhub/coconut/graphs/contributors
116
-
117
- __ Contributor_
118
- .. _Contributor: http://coconut.readthedocs.io/en/develop/CONTRIBUTING.html
119
-
120
- Backers
121
- -------
122
-
123
- Thank you to all our backers! `Become a backer`__.
124
-
125
- .. image:: https://opencollective.com/coconut/backers.svg?width=890
126
- :target: https://opencollective.com/coconut#backers
127
-
128
- __ Backer_
129
- .. _Backer: https://opencollective.com/coconut#backer
130
-
131
- Sponsors
132
- --------
133
-
134
- Support Coconut by becoming a sponsor. Your logo will show up here with a link to your website. `Become a sponsor`__.
135
-
136
- .. image:: https://opencollective.com/XX/sponsor/0/avatar.svg
137
- :target: https://opencollective.com/coconut/sponsor/0/website
138
-
139
- __ Sponsor_
140
- .. _Sponsor: https://opencollective.com/coconut#sponsor