ACIL FM
Dark
Refresh
Current DIR:
/opt/alt/python313/lib64/python3.13/test/test_free_threading
/
opt
alt
python313
lib64
python3.13
test
test_free_threading
Upload
Zip Selected
Delete Selected
Pilih semua
Nama
Ukuran
Permission
Aksi
__pycache__
-
chmod
Open
Rename
Delete
test_code.py
912 B
chmod
View
DL
Edit
Rename
Delete
test_dict.py
5.44 MB
chmod
View
DL
Edit
Rename
Delete
test_func_annotations.py
2.55 MB
chmod
View
DL
Edit
Rename
Delete
test_gc.py
1.45 MB
chmod
View
DL
Edit
Rename
Delete
test_list.py
1.77 MB
chmod
View
DL
Edit
Rename
Delete
test_monitoring.py
6.42 MB
chmod
View
DL
Edit
Rename
Delete
test_set.py
1.08 MB
chmod
View
DL
Edit
Rename
Delete
test_slots.py
1001 B
chmod
View
DL
Edit
Rename
Delete
test_str.py
1.97 MB
chmod
View
DL
Edit
Rename
Delete
test_tokenize.py
2.16 MB
chmod
View
DL
Edit
Rename
Delete
test_type.py
3.57 MB
chmod
View
DL
Edit
Rename
Delete
__init__.py
225 B
chmod
View
DL
Edit
Rename
Delete
Edit file: /opt/alt/python313/lib64/python3.13/test/test_free_threading/test_slots.py
import threading from test.support import threading_helper from unittest import TestCase def run_in_threads(targets): """Run `targets` in separate threads""" threads = [ threading.Thread(target=target) for target in targets ] for thread in threads: thread.start() for thread in threads: thread.join() @threading_helper.requires_working_threading() class TestSlots(TestCase): def test_object(self): class Spam: __slots__ = [ "eggs", ] def __init__(self, initial_value): self.eggs = initial_value spam = Spam(0) iters = 20_000 def writer(): for _ in range(iters): spam.eggs += 1 def reader(): for _ in range(iters): eggs = spam.eggs assert type(eggs) is int assert 0 <= eggs <= iters run_in_threads([writer, reader, reader, reader])
Simpan
Batal
Isi Zip:
Unzip
Create
Buat Folder
Buat File
Terminal / Execute
Run
Chmod Bulk
All File
All Folder
All File dan Folder
Apply