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
c6897854
Kaydet (Commit)
c6897854
authored
Mar 31, 2012
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix-up a comment
üst
7f7a5a7b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
functools.py
Lib/functools.py
+2
-3
No files found.
Lib/functools.py
Dosyayı görüntüle @
c6897854
...
@@ -172,7 +172,7 @@ def lru_cache(maxsize=100, typed=False):
...
@@ -172,7 +172,7 @@ def lru_cache(maxsize=100, typed=False):
cache
=
{}
cache
=
{}
hits
=
misses
=
0
hits
=
misses
=
0
kwd_mark
=
(
object
(),)
# separate positional and keyword args
kwd_mark
=
(
object
(),)
# separate positional and keyword args
cache_get
=
cache
.
get
# bound method to lookup key or return None
cache_get
=
cache
.
get
# bound method to lookup
a
key or return None
sentinel
=
object
()
# unique object used with cache_get
sentinel
=
object
()
# unique object used with cache_get
_len
=
len
# localize the global len() function
_len
=
len
# localize the global len() function
lock
=
Lock
()
# because linkedlist updates aren't threadsafe
lock
=
Lock
()
# because linkedlist updates aren't threadsafe
...
@@ -250,8 +250,7 @@ def lru_cache(maxsize=100, typed=False):
...
@@ -250,8 +250,7 @@ def lru_cache(maxsize=100, typed=False):
# empty the oldest link and make it the new root
# empty the oldest link and make it the new root
root
=
root
[
NEXT
]
root
=
root
[
NEXT
]
del
cache
[
root
[
KEY
]]
del
cache
[
root
[
KEY
]]
root
[
KEY
]
=
None
root
[
KEY
]
=
root
[
RESULT
]
=
None
root
[
RESULT
]
=
None
misses
+=
1
misses
+=
1
return
result
return
result
...
...
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