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
a6e16a86
Kaydet (Commit)
a6e16a86
authored
Agu 21, 2002
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Replace all cases of "while 1" with "while True".
Though slightly slower, has better clarity and teaching value.
üst
80d21af6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
tut.tex
Doc/tut/tut.tex
+7
-7
No files found.
Doc/tut/tut.tex
Dosyayı görüntüle @
a6e16a86
...
@@ -1215,7 +1215,7 @@ program requires no action.
...
@@ -1215,7 +1215,7 @@ program requires no action.
For example:
For example:
\begin{verbatim}
\begin{verbatim}
>>> while
1
:
>>> while
True
:
... pass # Busy-wait for keyboard interrupt
... pass # Busy-wait for keyboard interrupt
...
...
\end{verbatim}
\end{verbatim}
...
@@ -1358,7 +1358,7 @@ arguments than it is defined
...
@@ -1358,7 +1358,7 @@ arguments than it is defined
\begin{verbatim}
\begin{verbatim}
def ask
_
ok(prompt, retries=4, complaint='Yes or no, please!'):
def ask
_
ok(prompt, retries=4, complaint='Yes or no, please!'):
while
1
:
while
True
:
ok = raw
_
input(prompt)
ok = raw
_
input(prompt)
if ok in ('y', 'ye', 'yes'): return 1
if ok in ('y', 'ye', 'yes'): return 1
if ok in ('n', 'no', 'nop', 'nope'): return 0
if ok in ('n', 'no', 'nop', 'nope'): return 0
...
@@ -3076,10 +3076,10 @@ Syntax errors, also known as parsing errors, are perhaps the most common
...
@@ -3076,10 +3076,10 @@ Syntax errors, also known as parsing errors, are perhaps the most common
kind of complaint you get while you are still learning Python:
kind of complaint you get while you are still learning Python:
\begin{verbatim}
\begin{verbatim}
>>> while
1
print 'Hello world'
>>> while
True
print 'Hello world'
File "<stdin>", line 1, in ?
File "<stdin>", line 1, in ?
while
1
print 'Hello world'
while
True
print 'Hello world'
^
^
SyntaxError: invalid syntax
SyntaxError: invalid syntax
\end{verbatim}
\end{verbatim}
...
@@ -3149,7 +3149,7 @@ supports); note that a user-generated interruption is signalled by
...
@@ -3149,7 +3149,7 @@ supports); note that a user-generated interruption is signalled by
raising the
\exception
{
KeyboardInterrupt
}
exception.
raising the
\exception
{
KeyboardInterrupt
}
exception.
\begin{verbatim}
\begin{verbatim}
>>> while
1
:
>>> while
True
:
... try:
... try:
... x = int(raw
_
input("Please enter a number: "))
... x = int(raw
_
input("Please enter a number: "))
... break
... break
...
@@ -3760,7 +3760,7 @@ later time. For example:
...
@@ -3760,7 +3760,7 @@ later time. For example:
\begin{verbatim}
\begin{verbatim}
xf = x.f
xf = x.f
while
1
:
while
True
:
print xf()
print xf()
\end{verbatim}
\end{verbatim}
...
...
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