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
7a168d96
Kaydet (Commit)
7a168d96
authored
Ock 21, 2011
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add example for __wrapped__.
üst
f1dae31e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
3.2.rst
Doc/whatsnew/3.2.rst
+11
-2
No files found.
Doc/whatsnew/3.2.rst
Dosyayı görüntüle @
7a168d96
...
@@ -736,6 +736,11 @@ functools
...
@@ -736,6 +736,11 @@ functools
it also gracefully skips over missing attributes such as :attr:`__doc__` which
it also gracefully skips over missing attributes such as :attr:`__doc__` which
might not be defined for the wrapped callable.
might not be defined for the wrapped callable.
In the above example, the cache can be removed by recovering the original
function:
>>> get_phone_number = get_phone_number.__wrapped__ # uncached function
(By Nick Coghlan and Terrence Cole; :issue:`9567`, :issue:`3445`, and
(By Nick Coghlan and Terrence Cole; :issue:`9567`, :issue:`3445`, and
:issue:`8814`.)
:issue:`8814`.)
...
@@ -943,10 +948,14 @@ datetime and time
...
@@ -943,10 +948,14 @@ datetime and time
:attr:`time.accept2dyear` be set to *False* so that large date ranges
:attr:`time.accept2dyear` be set to *False* so that large date ranges
can be used without guesswork:
can be used without guesswork:
>>> time.accept2dyear = 1 # guess whether 11 means 11 or 2011
>>> warnings.resetwarnings() # remove the default warning filters
>>> time.accept2dyear = True # guess whether 11 means 11 or 2011
>>> time.asctime((11, 1, 1, 12, 34, 56, 4, 1, 0))
>>> time.asctime((11, 1, 1, 12, 34, 56, 4, 1, 0))
Warning (from warnings module):
...
DeprecationWarning: Century info guessed for a 2-digit year.
'Fri Jan 1 12:34:56 2011'
'Fri Jan 1 12:34:56 2011'
>>> time.accept2dyear =
0
# use the full range of allowable dates
>>> time.accept2dyear =
False
# use the full range of allowable dates
>>> time.asctime((11, 1, 1, 12, 34, 56, 4, 1, 0))
>>> time.asctime((11, 1, 1, 12, 34, 56, 4, 1, 0))
'Fri Jan 1 12:34:56 11'
'Fri Jan 1 12:34:56 11'
...
...
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