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
79212998
Kaydet (Commit)
79212998
authored
Agu 21, 2006
tarafından
Neal Norwitz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
use isinstance instead of type. Use bool instead of int for flag.
üst
48563e84
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
test_support.py
Lib/test/test_support.py
+4
-5
No files found.
Lib/test/test_support.py
Dosyayı görüntüle @
79212998
...
@@ -110,15 +110,14 @@ def bind_port(sock, host='', preferred_port=54321):
...
@@ -110,15 +110,14 @@ def bind_port(sock, host='', preferred_port=54321):
FUZZ
=
1e-6
FUZZ
=
1e-6
def
fcmp
(
x
,
y
):
# fuzzy comparison function
def
fcmp
(
x
,
y
):
# fuzzy comparison function
if
type
(
x
)
==
type
(
0.0
)
or
type
(
y
)
==
type
(
0.0
):
if
isinstance
(
x
,
float
)
or
isinstance
(
y
,
float
):
try
:
try
:
x
,
y
=
coerce
(
x
,
y
)
fuzz
=
(
abs
(
x
)
+
abs
(
y
))
*
FUZZ
fuzz
=
(
abs
(
x
)
+
abs
(
y
))
*
FUZZ
if
abs
(
x
-
y
)
<=
fuzz
:
if
abs
(
x
-
y
)
<=
fuzz
:
return
0
return
0
except
:
except
:
pass
pass
elif
type
(
x
)
==
type
(
y
)
and
type
(
x
)
in
(
type
(()),
type
([]
)):
elif
type
(
x
)
==
type
(
y
)
and
isinstance
(
x
,
(
tuple
,
list
)):
for
i
in
range
(
min
(
len
(
x
),
len
(
y
))):
for
i
in
range
(
min
(
len
(
x
),
len
(
y
))):
outcome
=
fcmp
(
x
[
i
],
y
[
i
])
outcome
=
fcmp
(
x
[
i
],
y
[
i
])
if
outcome
!=
0
:
if
outcome
!=
0
:
...
@@ -128,9 +127,9 @@ def fcmp(x, y): # fuzzy comparison function
...
@@ -128,9 +127,9 @@ def fcmp(x, y): # fuzzy comparison function
try
:
try
:
unicode
unicode
have_unicode
=
1
have_unicode
=
True
except
NameError
:
except
NameError
:
have_unicode
=
0
have_unicode
=
False
is_jython
=
sys
.
platform
.
startswith
(
'java'
)
is_jython
=
sys
.
platform
.
startswith
(
'java'
)
...
...
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