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
07d8d641
Kaydet (Commit)
07d8d641
authored
Agu 20, 2001
tarafından
Barry Warsaw
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Committing and closing SF patch #403671 by Finn Bock to help Jython
pass these tests.
üst
4533f60d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
11 deletions
+31
-11
test_class.py
Lib/test/test_class.py
+31
-11
No files found.
Lib/test/test_class.py
Dosyayı görüntüle @
07d8d641
...
...
@@ -51,7 +51,6 @@ testmeths = [
# generic operations
"init"
,
"del"
,
]
# These need to return something other than None
...
...
@@ -86,6 +85,9 @@ class AllTests:
print
"__cmp__:"
,
args
return
0
def
__del__
(
self
,
*
args
):
print
"__del__:"
,
args
for
method
in
testmeths
:
exec
"""def __
%(method)
s__(self, *args):
print "__
%(method)
s__:", args
...
...
@@ -161,21 +163,37 @@ del AllTests.__getslice__
del
AllTests
.
__setslice__
del
AllTests
.
__delslice__
testme
[:
42
]
testme
[:
42
]
=
"The Answer"
del
testme
[:
42
]
import
sys
if
sys
.
platform
[:
4
]
!=
'java'
:
testme
[:
42
]
testme
[:
42
]
=
"The Answer"
del
testme
[:
42
]
else
:
# This works under Jython, but the actual slice values are
# different.
print
"__getitem__: (slice(0, 42, None),)"
print
"__setitem__: (slice(0, 42, None), 'The Answer')"
print
"__delitem__: (slice(0, 42, None),)"
# Unary operations
-
testme
+
testme
abs
(
testme
)
int
(
testme
)
long
(
testme
)
float
(
testme
)
oct
(
testme
)
hex
(
testme
)
if
sys
.
platform
[:
4
]
!=
'java'
:
int
(
testme
)
long
(
testme
)
float
(
testme
)
oct
(
testme
)
hex
(
testme
)
else
:
# Jython enforced that the these methods return
# a value of the expected type.
print
"__int__: ()"
print
"__long__: ()"
print
"__float__: ()"
print
"__oct__: ()"
print
"__hex__: ()"
# And the rest...
...
...
@@ -198,7 +216,9 @@ testme != 1
# This test has to be last (duh.)
del
testme
if
sys
.
platform
[:
4
]
==
'java'
:
import
java
java
.
lang
.
System
.
gc
()
# Interfering tests
...
...
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