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
dc90cc2b
Kaydet (Commit)
dc90cc2b
authored
Ara 11, 2000
tarafından
Thomas Wouters
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Additional docs for __iadd__ and family, closing SF bug #117178 and SF patch
#102169.
üst
2a22200a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
ref3.tex
Doc/ref/ref3.tex
+26
-0
No files found.
Doc/ref/ref3.tex
Dosyayı görüntüle @
dc90cc2b
...
@@ -1293,6 +1293,32 @@ try calling \method{__rpow__()} (the coercion rules would become too
...
@@ -1293,6 +1293,32 @@ try calling \method{__rpow__()} (the coercion rules would become too
complicated).
complicated).
\end{methoddesc}
\end{methoddesc}
\begin{methoddesc}
[numeric object]
{__
iadd
__}{
self, other
}
\methodline
[numeric object]
{__
isub
__}{
self, other
}
\methodline
[numeric object]
{__
imul
__}{
self, other
}
\methodline
[numeric object]
{__
idiv
__}{
self, other
}
\methodline
[numeric object]
{__
imod
__}{
self, other
}
\methodline
[numeric object]
{__
ipow
__}{
self, other
\optional
{
, modulo
}}
\methodline
[numeric object]
{__
ilshift
__}{
self, other
}
\methodline
[numeric object]
{__
irshift
__}{
self, other
}
\methodline
[numeric object]
{__
iand
__}{
self, other
}
\methodline
[numeric object]
{__
ixor
__}{
self, other
}
\methodline
[numeric object]
{__
ior
__}{
self, other
}
These methods are called to implement the augmented arithmetic operations
(
\code
{
+=
}
,
\code
{
-=
}
,
\code
{
*=
}
,
\code
{
/=
}
,
\code
{
\%
=
}
,
\code
{
**=
}
,
\code
{
<<=
}
,
\code
{
>>=
}
,
\code
{
\&
=
}
,
\code
{
\^
=
}
,
\code
{
|=
}
). These methods
should attempt to do the operation in-place (modifying
\var
{
self
}
) and
return the result (which could be, but does not have to be,
\var
{
self
}
). If
a specific method is not defined, the augmented operation falls back to the
normal methods. For instance, to evaluate the expression
\var
{
x
}
\code
{
+=
}
\var
{
y
}
, where
\var
{
x
}
is an instance of a class that has an
\method
{__
iadd
__
()
}
method,
\code
{
\var
{
x
}
.
__
iadd
__
(
\var
{
y
}
)
}
is called. If
\var
{
x
}
is an instance of a class that does not define a
\method
{__
iadd()
}
method,
\code
{
\var
{
x
}
.
__
add
__
(
\var
{
y
}
)
}
and
\code
{
\var
{
y
}
.
__
radd
__
(
\var
{
x
}
)
}
are considered, as with the evaluation of
\var
{
x
}
\code
{
+
}
\var
{
y
}
.
\end{methoddesc}
\begin{methoddesc}
[numeric object]
{__
neg
__}{
self
}
\begin{methoddesc}
[numeric object]
{__
neg
__}{
self
}
\methodline
[numeric object]
{__
pos
__}{
self
}
\methodline
[numeric object]
{__
pos
__}{
self
}
\methodline
[numeric object]
{__
abs
__}{
self
}
\methodline
[numeric object]
{__
abs
__}{
self
}
...
...
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