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
4dd6b84e
Kaydet (Commit)
4dd6b84e
authored
Mar 17, 1995
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
added table of precedences
üst
55dd113b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
102 additions
and
0 deletions
+102
-0
ref5.tex
Doc/ref/ref5.tex
+51
-0
ref5.tex
Doc/ref5.tex
+51
-0
No files found.
Doc/ref/ref5.tex
Dosyayı görüntüle @
4dd6b84e
...
...
@@ -705,3 +705,54 @@ tuple, but rather yields the value of that expression (condition).
(To create an empty tuple, use an empty pair of parentheses:
\verb
@
()
@
.)
\section
{
Summary
}
The following table summarizes the operator precedences in Python,
from lowest precedence (least binding) to highest precedence (most
binding). Operators in the same box have the same precedence. Unless
the syntax is explicitly given, operators are binary. Operators in
the same box group left to right (except for comparisons, which
chain from left to right --- see above).
\begin{center}
\begin{tabular}
{
|c|c|
}
\hline
\code
{
or
}
&
Boolean OR
\\
\hline
\code
{
and
}
&
Boolean AND
\\
\hline
\code
{
not
}
\var
{
x
}
&
Boolean NOT
\\
\hline
\code
{
in
}
,
\code
{
not
}
\code
{
in
}
&
Membership tests
\\
\code
{
is
}
,
\code
{
is
}
\code
{
not
}
&
Identity tests
\\
\code
{
<
}
,
\code
{
<=
}
,
\code
{
>
}
,
\code
{
>=
}
,
\code
{
<>
}
,
\code
{
!=
}
,
\code
{
=
}
&
Comparisons
\\
\hline
\code
{
|
}
&
Bitwise OR
\\
\hline
\code
{
\^
}
&
Bitwise XOR
\\
\hline
\code
{
\&
}
&
Bitwise AND
\\
\hline
\code
{
<<
}
,
\code
{
>>
}
&
Shifts
\\
\hline
\code
{
+
}
,
\code
{
-
}
&
Addition and subtraction
\\
\hline
\code
{
*
}
,
\code
{
/
}
,
\code
{
\%
}
&
Multiplication, division, remainder
\\
\hline
\code
{
+
\var
{
x
}}
,
\code
{
-
\var
{
x
}}
&
Positive, negative
\\
\code
{
\~\var
{
x
}}
&
Bitwise not
\\
\hline
\code
{
\var
{
x
}
.
\var
{
attribute
}}
&
Attribute reference
\\
\code
{
\var
{
x
}
[
\var
{
index
}
]
}
&
Subscription
\\
\code
{
\var
{
x
}
[
\var
{
index
}
:
\var
{
index
}
]
}
&
Slicing
\\
\code
{
\var
{
f
}
(
\var
{
arguments
}
...)
}
&
Function call
\\
\hline
\code
{
(
\var
{
expressions
}
\ldots
)
}
&
Binding or tuple display
\\
\code
{
[
\var
{
expressions
}
\ldots
]
}
&
List display
\\
\code
{
\{\var
{
key
}
:
\var
{
datum
}
\ldots\}
}
&
Dictionary display
\\
\code
{
`
\var
{
expression
}
\ldots
`
}
&
String conversion
\\
\hline
\end{tabular}
\end{center}
Doc/ref5.tex
Dosyayı görüntüle @
4dd6b84e
...
...
@@ -705,3 +705,54 @@ tuple, but rather yields the value of that expression (condition).
(To create an empty tuple, use an empty pair of parentheses:
\verb
@
()
@
.)
\section
{
Summary
}
The following table summarizes the operator precedences in Python,
from lowest precedence (least binding) to highest precedence (most
binding). Operators in the same box have the same precedence. Unless
the syntax is explicitly given, operators are binary. Operators in
the same box group left to right (except for comparisons, which
chain from left to right --- see above).
\begin{center}
\begin{tabular}
{
|c|c|
}
\hline
\code
{
or
}
&
Boolean OR
\\
\hline
\code
{
and
}
&
Boolean AND
\\
\hline
\code
{
not
}
\var
{
x
}
&
Boolean NOT
\\
\hline
\code
{
in
}
,
\code
{
not
}
\code
{
in
}
&
Membership tests
\\
\code
{
is
}
,
\code
{
is
}
\code
{
not
}
&
Identity tests
\\
\code
{
<
}
,
\code
{
<=
}
,
\code
{
>
}
,
\code
{
>=
}
,
\code
{
<>
}
,
\code
{
!=
}
,
\code
{
=
}
&
Comparisons
\\
\hline
\code
{
|
}
&
Bitwise OR
\\
\hline
\code
{
\^
}
&
Bitwise XOR
\\
\hline
\code
{
\&
}
&
Bitwise AND
\\
\hline
\code
{
<<
}
,
\code
{
>>
}
&
Shifts
\\
\hline
\code
{
+
}
,
\code
{
-
}
&
Addition and subtraction
\\
\hline
\code
{
*
}
,
\code
{
/
}
,
\code
{
\%
}
&
Multiplication, division, remainder
\\
\hline
\code
{
+
\var
{
x
}}
,
\code
{
-
\var
{
x
}}
&
Positive, negative
\\
\code
{
\~\var
{
x
}}
&
Bitwise not
\\
\hline
\code
{
\var
{
x
}
.
\var
{
attribute
}}
&
Attribute reference
\\
\code
{
\var
{
x
}
[
\var
{
index
}
]
}
&
Subscription
\\
\code
{
\var
{
x
}
[
\var
{
index
}
:
\var
{
index
}
]
}
&
Slicing
\\
\code
{
\var
{
f
}
(
\var
{
arguments
}
...)
}
&
Function call
\\
\hline
\code
{
(
\var
{
expressions
}
\ldots
)
}
&
Binding or tuple display
\\
\code
{
[
\var
{
expressions
}
\ldots
]
}
&
List display
\\
\code
{
\{\var
{
key
}
:
\var
{
datum
}
\ldots\}
}
&
Dictionary display
\\
\code
{
`
\var
{
expression
}
\ldots
`
}
&
String conversion
\\
\hline
\end{tabular}
\end{center}
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