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
3b4fb041
Kaydet (Commit)
3b4fb041
authored
Nis 13, 2006
tarafından
Andrew M. Kuchling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[Bug #1464571] Mention that generator's .gi_frame can now be None
üst
6fc69765
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
whatsnew25.tex
Doc/whatsnew/whatsnew25.tex
+12
-2
No files found.
Doc/whatsnew/whatsnew25.tex
Dosyayı görüntüle @
3b4fb041
...
...
@@ -412,7 +412,7 @@ implementation by Thomas Lee.}
%======================================================================
\section
{
PEP 342: New Generator Features
}
\section
{
PEP 342: New Generator Features
\label
{
section-generators
}
}
Python 2.5 adds a simple way to pass values
\emph
{
into
}
a generator.
As introduced in Python 2.3, generators only produce output; once a
...
...
@@ -541,7 +541,7 @@ figure out patterns for using coroutines effectively in Python.
The addition of the
\method
{
close()
}
method has one side effect that
isn't obvious.
\method
{
close()
}
is called when a generator is
garbage-collected, so this means the generator's code gets one last
chance to run before the generator is destroyed
, and t
his last chance
chance to run before the generator is destroyed
. T
his last chance
means that
\code
{
try...finally
}
statements in generators can now be
guaranteed to work; the
\keyword
{
finally
}
clause will now always get a
chance to run. The syntactic restriction that you couldn't mix
...
...
@@ -552,6 +552,11 @@ necessary in order to implement the \keyword{with} statement
described by PEP 343. We'll look at this new statement in the following
section.
Another even more esoteric effect of this change: previously, the
\member
{
gi
_
frame
}
attribute of a generator was always a frame object.
It's now possible for
\member
{
gi
_
frame
}
to be
\code
{
None
}
once the generator has been exhausted.
\begin{seealso}
\seepep
{
342
}{
Coroutines via Enhanced Generators
}{
PEP written by
...
...
@@ -1641,6 +1646,11 @@ this triggered a warning, not a syntax error.
\item
The
\module
{
pickle
}
module no longer uses the deprecated
\var
{
bin
}
parameter.
\item
Previously, the
\member
{
gi
_
frame
}
attribute of a generator
was always a frame object. Because of the
\pep
{
342
}
changes
described in section~
\ref
{
section-generators
}
, it's now possible
for
\member
{
gi
_
frame
}
to be
\code
{
None
}
.
\item
C API: Many functions now use
\ctype
{
Py
_
ssize
_
t
}
instead of
\ctype
{
int
}
to allow processing more data
on 64-bit machines. Extension code may need to make
...
...
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