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
029656fb
Kaydet (Commit)
029656fb
authored
Haz 30, 2008
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #3236: Return small longs from PyLong_FromString.
üst
2f5799b7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
0 deletions
+13
-0
test_int.py
Lib/test/test_int.py
+3
-0
NEWS
Misc/NEWS
+2
-0
longobject.c
Objects/longobject.c
+8
-0
No files found.
Lib/test/test_int.py
Dosyayı görüntüle @
029656fb
...
...
@@ -95,6 +95,9 @@ class IntTestCases(unittest.TestCase):
self
.
assertRaises
(
ValueError
,
int
,
"0b"
,
2
)
self
.
assertRaises
(
ValueError
,
int
,
"0b"
,
0
)
# Bug #3236: Return small longs from PyLong_FromString
self
.
assert_
(
int
(
"10"
)
is
10
)
self
.
assert_
(
int
(
"-1"
)
is
-
1
)
# SF bug 1334662: int(string, base) wrong answers
# Various representations of 2**32 evaluated to 0
...
...
Misc/NEWS
Dosyayı görüntüle @
029656fb
...
...
@@ -12,6 +12,8 @@ What's new in Python 3.0b2?
Core and Builtins
-----------------
- Issue #3236: Return small longs from PyLong_FromString.
Library
-------
...
...
Objects/longobject.c
Dosyayı görüntüle @
029656fb
...
...
@@ -1981,6 +1981,14 @@ digit beyond the first.
goto
onError
;
if
(
pend
)
*
pend
=
str
;
long_normalize
(
z
);
if
(
ABS
(
Py_SIZE
(
z
))
<=
1
)
{
long
res
=
MEDIUM_VALUE
(
z
);
if
(
-
NSMALLPOSINTS
<=
res
&&
res
<=
NSMALLPOSINTS
)
{
Py_DECREF
(
z
);
return
PyLong_FromLong
(
res
);
}
}
return
(
PyObject
*
)
z
;
onError:
...
...
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