Skip to content

Commit 8eded5c

Browse files
Merge pull request #186 from Distributive-Network/philippe/fix/176
Philippe/fix/176
2 parents c93913d + b8c8b92 commit 8eded5c

25 files changed

+3029
-151
lines changed

LICENSE

+54
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,57 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
22+
23+
-------------------------------------------------------------------------------
24+
25+
Python Software Foundation License Version 2
26+
27+
Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
28+
2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023
29+
Python Software Foundation; All Rights Reserved
30+
31+
1. This LICENSE AGREEMENT is between the Python Software Foundation
32+
("PSF"), and the Individual or Organization ("Licensee") accessing and
33+
otherwise using this software ("Python") in source or binary form and
34+
its associated documentation.
35+
36+
2. Subject to the terms and conditions of this License Agreement, PSF hereby
37+
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
38+
analyze, test, perform and/or display publicly, prepare derivative works,
39+
distribute, and otherwise use Python alone or in any derivative version,
40+
provided, however, that PSF's License Agreement and PSF's notice of copyright,
41+
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
42+
2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Python Software Foundation;
43+
All Rights Reserved" are retained in Python alone or in any derivative version
44+
prepared by Licensee.
45+
46+
3. In the event Licensee prepares a derivative work that is based on
47+
or incorporates Python or any part thereof, and wants to make
48+
the derivative work available to others as provided herein, then
49+
Licensee hereby agrees to include in any such work a brief summary of
50+
the changes made to Python.
51+
52+
4. PSF is making Python available to Licensee on an "AS IS"
53+
basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
54+
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
55+
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
56+
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
57+
INFRINGE ANY THIRD PARTY RIGHTS.
58+
59+
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
60+
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
61+
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
62+
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
63+
64+
6. This License Agreement will automatically terminate upon a material
65+
breach of its terms and conditions.
66+
67+
7. Nothing in this License Agreement shall be deemed to create any
68+
relationship of agency, partnership, or joint venture between PSF and
69+
Licensee. This License Agreement does not grant permission to use PSF
70+
trademarks or trade name in a trademark sense to endorse or promote
71+
products or services of Licensee, or any third party.
72+
73+
8. By copying, installing or otherwise using Python, Licensee
74+
agrees to be bound by the terms and conditions of this License
75+
Agreement.

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ js_eval("console.log")('hello, world')
3333
- JS Date objects are represented by Python datetime.datetime objects
3434
- Intrinsics (boolean, number, null, undefined) are passed by value
3535
- JS Functions are automatically wrapped so that they behave like Python functions, and vice-versa
36+
- Python Lists are represented by JS true Arrays
3637

3738
### Roadmap
3839
- [done] JS instrinsics coerce to Python intrinsics
@@ -54,6 +55,7 @@ js_eval("console.log")('hello, world')
5455
- Python host environment supplies basic subsets of NodeJS's fs, path, process, etc, modules; as-needed by dcp-client (other project?)
5556
- [done] Python TypedArrays coerce to JS TypeArrays
5657
- [done] JS TypedArrays coerce to Python TypeArrays
58+
- [done] Python List coerce to JS Arrays
5759

5860
## Build Instructions
5961

@@ -233,7 +235,7 @@ that if you update an object in JavaScript, the corresponding Dict in Python wil
233235
| Bool | boolean
234236
| Function | function
235237
| Dict | object
236-
| List | Array-like object
238+
| List | Array
237239
| datetime | Date object
238240
| awaitable | Promise
239241
| Error | Error object
@@ -248,7 +250,7 @@ that if you update an object in JavaScript, the corresponding Dict in Python wil
248250
| function | Function
249251
| object - most | pythonmonkey.JSObjectProxy (Dict)
250252
| object - Date | datetime
251-
| object - Array | List
253+
| object - Array | pythonmonkey.JSArrayProxy (List)
252254
| object - Promise | awaitable
253255
| object - ArrayBuffer | Buffer
254256
| object - type arrays | Buffer

cmake/modules/FindSpiderMonkey.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ endif()
4040
set(SPIDERMONKEY_PATHS
4141
"${CMAKE_CURRENT_SOURCE_DIR}/_spidermonkey_install"
4242
"${CMAKE_CURRENT_SOURCE_DIR}/_spidermonkey_install/lib"
43+
"${CMAKE_CURRENT_SOURCE_DIR}/_spidermonkey_install/include/mozjs-115"
4344
${SPIDERMONKEY_ROOT}
4445
$ENV{SPIDERMONKEY_ROOT}
4546
~/Library/Frameworks

include/DictType.hh

-15
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,6 @@ public:
3838
DictType(JSContext *cx, JS::Handle<JS::Value> jsObject);
3939

4040
const TYPE returnType = TYPE::DICT;
41-
/**
42-
* @brief The 'set' method for a python dictionary. Sets the approprite 'key' in the dictionary with the appropriate 'value'
43-
*
44-
* @param key The key of the dictionary item
45-
* @param value The value of the dictionary item
46-
*/
47-
void set(PyType *key, PyType *value);
48-
49-
/**
50-
* @brief Gets the dictionary item at the given 'key'
51-
*
52-
* @param key The key of the item in question
53-
* @return PyType* Returns a pointer to the appropriate PyType object
54-
*/
55-
PyType *get(PyType *key) const;
5641
};
5742

5843
#endif

0 commit comments

Comments
 (0)