You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Dirty NIF execution** - Python runs on dirty schedulers, never blocking the BEAM
26
27
-**Elixir support** - Works seamlessly from Elixir via the `:py` module
@@ -244,6 +245,52 @@ py:state_clear().
244
245
245
246
This is backed by ETS with `{write_concurrency, true}`, so counters are atomic and fast.
246
247
248
+
## Process-Bound Python Environments
249
+
250
+
Each Erlang process gets its own isolated Python namespace. Variables, imports, and objects defined in one process are invisible to others, even when using the same interpreter.
251
+
252
+
```erlang
253
+
%% Process A defines state
254
+
spawn(fun() ->
255
+
Ctx=py:context(1),
256
+
ok=py:exec(Ctx, <<"counter = 0">>),
257
+
{ok, 0} =py:eval(Ctx, <<"counter">>)
258
+
end).
259
+
260
+
%% Process B - same context, but isolated namespace
261
+
spawn(fun() ->
262
+
Ctx=py:context(1),
263
+
%% 'counter' is undefined here - different process
0 commit comments