Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
3fc2fde7
Kaydet (Commit)
3fc2fde7
authored
Tem 15, 2004
tarafından
Andrew M. Kuchling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Typo fixes
üst
00457170
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
_threading_local.py
Lib/_threading_local.py
+4
-4
No files found.
Lib/_threading_local.py
Dosyayı görüntüle @
3fc2fde7
"""Thread-local objects
"""Thread-local objects
(Note that this module provides a Python version of thread
(Note that this module provides a Python version of thread
threading.local class. De
o
ending on the version of Python you're
threading.local class. De
p
ending on the version of Python you're
using, there may be a faster one available. You should always import
using, there may be a faster one available. You should always import
the local class from threading.)
the local class from threading.)
Thread-local objects support the management of thread-local data.
Thread-local objects support the management of thread-local data.
If you have data that you want to be local to a thread, simply create
If you have data that you want to be local to a thread, simply create
a thread-local object and use it
'
s attributes:
a thread-local object and use its attributes:
>>> mydata = local()
>>> mydata = local()
>>> mydata.number = 42
>>> mydata.number = 42
...
@@ -100,7 +100,7 @@ As before, we can access the data in a separate thread:
...
@@ -100,7 +100,7 @@ As before, we can access the data in a separate thread:
>>> log
>>> log
[[('color', 'red'), ('initialized', True)], 11]
[[('color', 'red'), ('initialized', True)], 11]
without
effecting this thread
s data:
without
affecting this thread'
s data:
>>> mydata.number
>>> mydata.number
2
2
...
@@ -229,7 +229,7 @@ class local(_localbase):
...
@@ -229,7 +229,7 @@ class local(_localbase):
try
:
try
:
del
__dict__
[
key
]
del
__dict__
[
key
]
except
KeyError
:
except
KeyError
:
pass
# didn't have nything in this thread
pass
# didn't have
a
nything in this thread
return
__del__
return
__del__
__del__
=
__del__
()
__del__
=
__del__
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment