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
1bdd9b03
Kaydet (Commit)
1bdd9b03
authored
Haz 04, 2002
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Test repair now that module.__init__ requires a name and initializes
__name__ and __doc__.
üst
bdabeccf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
test_descr.py
Lib/test/test_descr.py
+7
-6
No files found.
Lib/test/test_descr.py
Dosyayı görüntüle @
1bdd9b03
...
@@ -342,17 +342,18 @@ def test_dir():
...
@@ -342,17 +342,18 @@ def test_dir():
import
sys
import
sys
class
M
(
type
(
sys
)):
class
M
(
type
(
sys
)):
pass
pass
minstance
=
M
()
minstance
=
M
(
"m"
)
minstance
.
b
=
2
minstance
.
b
=
2
minstance
.
a
=
1
minstance
.
a
=
1
vereq
(
dir
(
minstance
),
[
'a'
,
'b'
])
names
=
[
x
for
x
in
dir
(
minstance
)
if
x
not
in
[
"__name__"
,
"__doc__"
]]
vereq
(
names
,
[
'a'
,
'b'
])
class
M2
(
M
):
class
M2
(
M
):
def
getdict
(
self
):
def
getdict
(
self
):
return
"Not a dict!"
return
"Not a dict!"
__dict__
=
property
(
getdict
)
__dict__
=
property
(
getdict
)
m2instance
=
M2
()
m2instance
=
M2
(
"m2"
)
m2instance
.
b
=
2
m2instance
.
b
=
2
m2instance
.
a
=
1
m2instance
.
a
=
1
vereq
(
m2instance
.
__dict__
,
"Not a dict!"
)
vereq
(
m2instance
.
__dict__
,
"Not a dict!"
)
...
@@ -818,8 +819,8 @@ def pymods():
...
@@ -818,8 +819,8 @@ def pymods():
import
sys
import
sys
MT
=
type
(
sys
)
MT
=
type
(
sys
)
class
MM
(
MT
):
class
MM
(
MT
):
def
__init__
(
self
):
def
__init__
(
self
,
name
):
MT
.
__init__
(
self
)
MT
.
__init__
(
self
,
name
)
def
__getattribute__
(
self
,
name
):
def
__getattribute__
(
self
,
name
):
log
.
append
((
"getattr"
,
name
))
log
.
append
((
"getattr"
,
name
))
return
MT
.
__getattribute__
(
self
,
name
)
return
MT
.
__getattribute__
(
self
,
name
)
...
@@ -829,7 +830,7 @@ def pymods():
...
@@ -829,7 +830,7 @@ def pymods():
def
__delattr__
(
self
,
name
):
def
__delattr__
(
self
,
name
):
log
.
append
((
"delattr"
,
name
))
log
.
append
((
"delattr"
,
name
))
MT
.
__delattr__
(
self
,
name
)
MT
.
__delattr__
(
self
,
name
)
a
=
MM
()
a
=
MM
(
"a"
)
a
.
foo
=
12
a
.
foo
=
12
x
=
a
.
foo
x
=
a
.
foo
del
a
.
foo
del
a
.
foo
...
...
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