Skip to content

Commit

Permalink
Release 0.2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
extremeheat committed Jul 21, 2021
1 parent deeee05 commit c0cb49d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
3 changes: 3 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.2.9
* py: Improve error handling on Python process exit.

## 0.2.7
* py: Add new JavaScript expression evaluator

Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,19 @@ are registered to a FinalizationRegistry. In Python, `__del__` is used to track
destruction. When the proxy object is destoryed on one side of the bridge, its refrence is removed
from the other side of the bridge. This means you don't have to deal with memory management.

* When doing a function call, any foreign objects will be sent to you as a reference. For example,
if you're in JavaScript and do a function call to Python that returns an array, you won't get a
JS array back, but you will get a reference to the Python array. You can still access the array
normally with the [] notation, as long as you use await. If you would like the bridge to turn
the foreign refrence to something native, you can request a primitive value by calling `.valueOf()`
on the Python array. This would give you a JS array. It works the same the other way around.
* The above behavior makes it very fast to pipe data from one function onto another, avoiding costly
conversions.
* This above behavior is not present for callbacks and function parameters. The bridge will try to
serialize what it can, and will give you a foreign reference if it's unable to serialize something.
So if you pass a JS object, you'll get a Python dict, but if the dict contains something like a class,
you'll get a reference in its place.

## Python

You can import the bridge module with
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pythonia",
"author": "extremeheat",
"description": "Bridge to call and interop Python APIs from Node.js",
"version": "0.2.8",
"version": "0.2.9",
"main": "./src/pythonia/index.js",
"types": "./src/pythonia/index.d.ts",
"repository": "https://github.com/extremeheat/JSPyBridge",
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# For a discussion on single-sourcing the version across setup.py and the
# project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='1!0.2.8', # Required
version='1!0.2.9', # Required

# This is a one-line description or tagline of what your project does. This
# corresponds to the "Summary" metadata field:
Expand Down

0 comments on commit c0cb49d

Please sign in to comment.