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
29a837d8
Kaydet (Commit)
29a837d8
authored
Mar 16, 2012
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
merge heads
üst
954cf578
d6569589
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
functools.py
Lib/functools.py
+1
-2
No files found.
Lib/functools.py
Dosyayı görüntüle @
29a837d8
...
@@ -156,6 +156,7 @@ def lru_cache(maxsize=100, typed=False):
...
@@ -156,6 +156,7 @@ def lru_cache(maxsize=100, typed=False):
lock
=
Lock
()
# needed because linkedlist isn't threadsafe
lock
=
Lock
()
# needed because linkedlist isn't threadsafe
root
=
[]
# root of circular doubly linked list
root
=
[]
# root of circular doubly linked list
root
[:]
=
[
root
,
root
,
None
,
None
]
# initialize by pointing to self
root
[:]
=
[
root
,
root
,
None
,
None
]
# initialize by pointing to self
PREV
,
NEXT
,
KEY
,
RESULT
=
0
,
1
,
2
,
3
# names of link fields
if
maxsize
is
None
:
if
maxsize
is
None
:
@wraps
(
user_function
)
@wraps
(
user_function
)
...
@@ -191,8 +192,6 @@ def lru_cache(maxsize=100, typed=False):
...
@@ -191,8 +192,6 @@ def lru_cache(maxsize=100, typed=False):
key
+=
tuple
(
map
(
type
,
args
))
key
+=
tuple
(
map
(
type
,
args
))
if
kwds
:
if
kwds
:
key
+=
tuple
(
type
(
v
)
for
k
,
v
in
sorted_items
)
key
+=
tuple
(
type
(
v
)
for
k
,
v
in
sorted_items
)
PREV
=
0
# names of link fields
NEXT
=
1
with
lock
:
with
lock
:
link
=
cache_get
(
key
)
link
=
cache_get
(
key
)
if
link
is
not
None
:
if
link
is
not
None
:
...
...
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