Comments (1)
This is in fact a TypeScript issue, by default tsc
transpiles this to the following JS code:
"use strict";
exports.__esModule = true;
var proxified_1 = require("pymport/proxified");
var d = proxified_1.PyObject.dict({ a: 1, b: 2 });
for (var _i = 0, d_1 = d; _i < d_1.length; _i++) {
var i = d_1[_i];
console.log(i);
}
which explains the output - a d
is an iterable but not a subscriptable.
Use the TypeScript transpiler option "downlevelIteration": true
to achieve correct behavior.
from pymport.
Related Issues (20)
- Installing packages that require building C code with the builtin interpreter fails HOT 6
- Binary Python modules such as `_ctypes` or `_ssl` fail to load on Windows with Python 3.11.1 HOT 1
- Rebuilding packages with C code on macOS fails when using the builtin interpreter HOT 1
- `lengtth` of an empty proxified `list` or `tuple` is `undefined` instead of `0`
- The result of `.toString()` on a proxified object is not identical to a raw PyObject HOT 1
- A proxified `PyObject` does not have a TypeScript type
- The `proxify` layer should hide itself in stack traces HOT 1
- `PyObject.item()` should follow the JS convention on undefined keys HOT 1
- Provide an opt-in automatic conversion of primitive values from Python to JS
- `proxify` does not properly expose static class members
- Huge memory leak when using proxified objects HOT 1
- `pympip3` / `pympip` are missing the executable bit HOT 1
- Race condition on macOS with worker_threads
- `pymport` leaks TLS memory when used in a `worker_thread` HOT 2
- Random crash with `worker_threads`
- V8 GC does not know if `PyObject`s grow after initialization
- Background Python operations can block the event loop
- Loading and unloading `pymport` leaks memory HOT 2
- A single `Buffer` argument is incorrectly transformed to Python `kwargs` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pymport.