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
b820d7f6
Kaydet (Commit)
b820d7f6
authored
Agu 22, 2016
tarafından
Mark Dickinson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #27792: force int return type for modulo operations involving bools.
üst
2eedc119
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
test_bool.py
Lib/test/test_bool.py
+7
-0
NEWS
Misc/NEWS
+4
-0
longobject.c
Objects/longobject.c
+5
-2
No files found.
Lib/test/test_bool.py
Dosyayı görüntüle @
b820d7f6
...
...
@@ -96,6 +96,13 @@ class BoolTest(unittest.TestCase):
self
.
assertEqual
(
False
/
1
,
0
)
self
.
assertIsNot
(
False
/
1
,
False
)
self
.
assertEqual
(
True
%
1
,
0
)
self
.
assertIsNot
(
True
%
1
,
False
)
self
.
assertEqual
(
True
%
2
,
1
)
self
.
assertIsNot
(
True
%
2
,
True
)
self
.
assertEqual
(
False
%
1
,
0
)
self
.
assertIsNot
(
False
%
1
,
False
)
for
b
in
False
,
True
:
for
i
in
0
,
1
,
2
:
self
.
assertEqual
(
b
**
i
,
int
(
b
)
**
i
)
...
...
Misc/NEWS
Dosyayı görüntüle @
b820d7f6
...
...
@@ -10,6 +10,10 @@ What's New in Python 3.6.0 beta 1
Core and Builtins
-----------------
- Issue #27792: The modulo operation applied to ``bool`` and other
``int`` subclasses now always returns an ``int``. Previously
the return type depended on the input values. Patch by Xiang Zhang.
- Issue #26984: int() now always returns an instance of exact int.
- Issue #25604: Fix a minor bug in integer true division; this bug could
...
...
Objects/longobject.c
Dosyayı görüntüle @
b820d7f6
...
...
@@ -2458,8 +2458,11 @@ long_divrem(PyLongObject *a, PyLongObject *b,
*
pdiv
=
(
PyLongObject
*
)
PyLong_FromLong
(
0
);
if
(
*
pdiv
==
NULL
)
return
-
1
;
Py_INCREF
(
a
);
*
prem
=
(
PyLongObject
*
)
a
;
*
prem
=
(
PyLongObject
*
)
long_long
((
PyObject
*
)
a
);
if
(
*
prem
==
NULL
)
{
Py_CLEAR
(
*
pdiv
);
return
-
1
;
}
return
0
;
}
if
(
size_b
==
1
)
{
...
...
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