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
3c1983fa
Kaydet (Commit)
3c1983fa
authored
Nis 30, 2006
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch #1479438: add \keyword markup for "with".
üst
3583cff5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
ref3.tex
Doc/ref/ref3.tex
+3
-3
ref7.tex
Doc/ref/ref7.tex
+2
-2
No files found.
Doc/ref/ref3.tex
Dosyayı görüntüle @
3c1983fa
...
...
@@ -2149,9 +2149,9 @@ using a generator function decorated with the
than writing individual
\method
{__
enter
__
()
}
and
\method
{__
exit
__
()
}
methods on a separate object when the state to be managed is complex.
With statement context objects also need to implement this method; they
are required to return themselves (that is, this method will simply
return
\var
{
self
}
).
\keyword
{
with
}
statement context objects also need to implement this
method; they are required to return themselves (that is, this method
will simply
return
\var
{
self
}
).
\end{methoddesc}
\begin{methoddesc}
[with statement context]
{__
enter
__}{
self
}
...
...
Doc/ref/ref7.tex
Dosyayı görüntüle @
3c1983fa
...
...
@@ -315,7 +315,7 @@ statement to generate exceptions may be found in section~\ref{raise}.
\versionadded
{
2.5
}
The
\keyword
{
with
}
statement is used to wrap the execution of a block
with methods defined by a context manager or
with
statement context
with methods defined by a context manager or
\keyword
{
with
}
statement context
object (see section~
\ref
{
context-managers
}
). This allows common
\keyword
{
try
}
...
\keyword
{
except
}
...
\keyword
{
finally
}
usage patterns to
be encapsulated for convenient reuse.
...
...
@@ -332,7 +332,7 @@ The execution of the \keyword{with} statement proceeds as follows:
\item
The context expression is evaluated, to obtain a context manager.
\item
The context manger's
\method
{__
context
__
()
}
method is
invoked to obtain a
with
statement context object.
invoked to obtain a
\keyword
{
with
}
statement context object.
\item
The context object's
\method
{__
enter
__
()
}
method is invoked.
...
...
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