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
e62430ed
Kaydet (Commit)
e62430ed
authored
Ock 15, 2015
tarafından
Ethan Furman
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue22988: clarify yield and exception blocks
üst
9fdb0fe1
2f825af7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
expressions.rst
Doc/reference/expressions.rst
+5
-4
No files found.
Doc/reference/expressions.rst
Dosyayı görüntüle @
e62430ed
...
...
@@ -330,8 +330,9 @@ The execution starts when one of the generator's methods is called. At that
time, the execution proceeds to the first yield expression, where it is
suspended again, returning the value of :token:`expression_list` to the generator's
caller. By suspended, we mean that all local state is retained, including the
current bindings of local variables, the instruction pointer, and the internal
evaluation stack. When the execution is resumed by calling one of the
current bindings of local variables, the instruction pointer, the internal
evaluation stack, and the state of any exception handling. When the execution
is resumed by calling one of the
generator's methods, the function can proceed exactly as if the yield expression
were just another external call. The value of the yield expression after
resuming depends on the method which resumed the execution. If
...
...
@@ -348,8 +349,8 @@ suspended. The only difference is that a generator function cannot control
where the execution should continue after it yields; the control is always
transferred to the generator's caller.
Yield expressions are allowed
in the :keyword:`try` clause of a :keyword:`try`
... :keyword:`finally` construct. If the
generator is not resumed before it is
Yield expressions are allowed
anywhere in a :keyword:`try` construct. If the
generator is not resumed before it is
finalized (by reaching a zero reference count or by being garbage collected),
the generator-iterator's :meth:`~generator.close` method will be called,
allowing any pending :keyword:`finally` clauses to execute.
...
...
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