Skip to main content
Stack Overflow for Teams is now Stack Internal: See how we’re powering the human intelligence layer of enterprise AI. Read more >
Filter by
Sorted by
Tagged with
3 votes
1 answer
84 views

With a class that inherits from dict, why does str() not use dict.__str__ when dict is earlier in the MRO of the class? Python 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0] on linux Type "...
Tniagcpm's user avatar
0 votes
1 answer
50 views

I was just following a tutorial on the usage of subinterpreters in python 3.12 . In the tutorial there is the following code snippet: def run_in_threads(total: int = 10): sub_interpreters = [] ...
ölkjamin's user avatar
0 votes
1 answer
343 views

Python 3.12 exposes the subinterpreter functionality: after starting the Python main.exe you can spawn multiple subinterpreter threads. Questions: As the subinterpreter threads run in the same ...
stustd's user avatar
  • 335
3 votes
1 answer
194 views

I wrote a single-threaded C++ code using Python C APIs where I start two subinterpreters Sub1 and Sub2, then I load a module M with both. If M imports certain modules (such as urllib.request or yaml), ...
Michele Agostini's user avatar
0 votes
1 answer
739 views

I'm attempting to run a python script that spawns a subinterpreter and a main interpreter, each responsible for doing some sort of work (Based on the example used in this article). The work I'm having ...
Mav's user avatar
  • 117
0 votes
1 answer
350 views

To my best knowledge if I have a CPU intensive work multithreading should work similar to linear execution of the same code. So I tested it using this simple code. import datetime import threading ...
Gaurav Aggarwal's user avatar
29 votes
3 answers
13k views

I'm playing around with the C API for Python, but it is quite difficult to understand some corner cases. I could test it, but it seems a bug-prone and time consuming. So I come here to see if somebody ...
MariusSiuram's user avatar
  • 3,714