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
0d8b4e33
Kaydet (Commit)
0d8b4e33
authored
Haz 23, 2009
tarafından
Nick Coghlan
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue 6288: Update contextlib.nested() docstring to reflect new documentation
üst
94819cf4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
contextlib.py
Lib/contextlib.py
+8
-10
No files found.
Lib/contextlib.py
Dosyayı görüntüle @
0d8b4e33
...
@@ -87,19 +87,17 @@ def contextmanager(func):
...
@@ -87,19 +87,17 @@ def contextmanager(func):
@contextmanager
@contextmanager
def
nested
(
*
managers
):
def
nested
(
*
managers
):
"""
Support multiple context managers in a single with-statement
.
"""
Combine multiple context managers into a single nested context manager
.
Code like this:
This function has been deprecated in favour of the multiple manager form
of the :keyword:`with` statement.
with nested(A, B, C) as (X, Y, Z):
<body>
is equivalent to this:
The one advantage of this function over the multiple manager form of the
:keyword:`with` statement is that argument unpacking allows it to be
used with a variable number of context managers as follows:
with A as X:
with nested(*managers):
with B as Y:
do_something()
with C as Z:
<body>
"""
"""
warn
(
"With-statements now directly support multiple context managers"
,
warn
(
"With-statements now directly support multiple context managers"
,
...
...
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