{"id":15471429,"url":"https://github.com/aisk/backports.interpreters","last_synced_at":"2025-05-01T11:45:31.505Z","repository":{"id":57413679,"uuid":"266590052","full_name":"aisk/backports.interpreters","owner":"aisk","description":"interpreters module in python which is backported from the future","archived":false,"fork":false,"pushed_at":"2024-01-31T09:12:07.000Z","size":18,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-01T11:45:03.441Z","etag":null,"topics":["backports","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aisk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-05-24T17:23:08.000Z","updated_at":"2024-11-28T16:34:45.000Z","dependencies_parsed_at":"2024-01-30T12:00:52.015Z","dependency_job_id":null,"html_url":"https://github.com/aisk/backports.interpreters","commit_stats":{"total_commits":15,"total_committers":2,"mean_commits":7.5,"dds":"0.19999999999999996","last_synced_commit":"0d5c3d3b5a8ba7f283959063e403ddf2eb3b7c24"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aisk%2Fbackports.interpreters","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aisk%2Fbackports.interpreters/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aisk%2Fbackports.interpreters/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aisk%2Fbackports.interpreters/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aisk","download_url":"https://codeload.github.com/aisk/backports.interpreters/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251871441,"owners_count":21657461,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backports","python"],"created_at":"2024-10-02T02:19:40.573Z","updated_at":"2025-05-01T11:45:31.485Z","avatar_url":"https://github.com/aisk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# backports.interpreters\n\n![Python package](https://github.com/aisk/backports.interpreters/workflows/Python%20package/badge.svg)\n\n![](https://steamuserimages-a.akamaihd.net/ugc/884253767814091683/33BD3074E50D3E841C647E8BEE4CF680C35B152D/)\n\nThe `interpreters` module described in [PEP554](https://www.python.org/dev/peps/pep-0554/), which is not implemented now. This is backported from the future.\n\n## Install\n\n```sh\n$ pip install backports.interpreters\n```\n\n## Example\n\n```sh\nfrom backports import interpreters\nimport threading\n\n\ndef task():\n    intp = interpreters.create()\n    intp.run(\"\"\"\na = 0\nfor i in range(99999999):\n    a += i\nprint(a)\n    \"\"\")\n\n\nts = []\nfor _ in range(8):\n    t = threading.Thread(target=task)\n    t.start()\n    ts.append(t)\n\nfor t in ts:\n    t.join()\n```\n\nRun this code with Python3.12, you will see Python will use 8 cores of CPU:\n\n![Python eats 8 CPU cores](https://i.v2ex.co/m80gRd7P.png)\n\n## Limitations\n\nOnly support python3.8+.\n\n---\n\n「すべてはシュタインズ・ゲートの選択である」\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faisk%2Fbackports.interpreters","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faisk%2Fbackports.interpreters","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faisk%2Fbackports.interpreters/lists"}