https://github.com/aisk/backports.interpreters
interpreters module in python which is backported from the future
https://github.com/aisk/backports.interpreters
backports python
Last synced: 9 months ago
JSON representation
interpreters module in python which is backported from the future
- Host: GitHub
- URL: https://github.com/aisk/backports.interpreters
- Owner: aisk
- License: lgpl-3.0
- Created: 2020-05-24T17:23:08.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-31T09:12:07.000Z (almost 2 years ago)
- Last Synced: 2025-05-01T11:45:03.441Z (9 months ago)
- Topics: backports, python
- Language: Python
- Homepage:
- Size: 17.6 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# backports.interpreters


The `interpreters` module described in [PEP554](https://www.python.org/dev/peps/pep-0554/), which is not implemented now. This is backported from the future.
## Install
```sh
$ pip install backports.interpreters
```
## Example
```sh
from backports import interpreters
import threading
def task():
intp = interpreters.create()
intp.run("""
a = 0
for i in range(99999999):
a += i
print(a)
""")
ts = []
for _ in range(8):
t = threading.Thread(target=task)
t.start()
ts.append(t)
for t in ts:
t.join()
```
Run this code with Python3.12, you will see Python will use 8 cores of CPU:

## Limitations
Only support python3.8+.
---
「すべてはシュタインズ・ゲートの選択である」