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
946749f6
Kaydet (Commit)
946749f6
authored
Ara 26, 1991
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use AttributeError
üst
2234bc91
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
newdir.py
Lib/lib-old/newdir.py
+6
-6
newdir.py
Lib/newdir.py
+6
-6
No files found.
Lib/lib-old/newdir.py
Dosyayı görüntüle @
946749f6
...
...
@@ -11,27 +11,27 @@ def getattr(x, name):
def
listattrs
(
x
):
try
:
dictkeys
=
x
.
__dict__
.
keys
()
except
(
Nam
eError
,
TypeError
):
except
(
Attribut
eError
,
TypeError
):
dictkeys
=
[]
#
try
:
methods
=
x
.
__methods__
except
(
Nam
eError
,
TypeError
):
except
(
Attribut
eError
,
TypeError
):
methods
=
[]
#
try
:
members
=
x
.
__members__
except
(
Nam
eError
,
TypeError
):
except
(
Attribut
eError
,
TypeError
):
members
=
[]
#
try
:
the_class
=
x
.
__class__
except
(
Nam
eError
,
TypeError
):
except
(
Attribut
eError
,
TypeError
):
the_class
=
None
#
try
:
bases
=
x
.
__bases__
except
(
Nam
eError
,
TypeError
):
except
(
Attribut
eError
,
TypeError
):
bases
=
()
#
total
=
dictkeys
+
methods
+
members
...
...
@@ -69,7 +69,7 @@ def is_function(x):
# Use a class method to make a function that can be called
# with or without arguments.
#
class
_dirclass
()
:
class
_dirclass
:
def
dir
(
args
):
if
type
(
args
)
=
type
(()):
return
listattrs
(
args
[
1
])
...
...
Lib/newdir.py
Dosyayı görüntüle @
946749f6
...
...
@@ -11,27 +11,27 @@ def getattr(x, name):
def
listattrs
(
x
):
try
:
dictkeys
=
x
.
__dict__
.
keys
()
except
(
Nam
eError
,
TypeError
):
except
(
Attribut
eError
,
TypeError
):
dictkeys
=
[]
#
try
:
methods
=
x
.
__methods__
except
(
Nam
eError
,
TypeError
):
except
(
Attribut
eError
,
TypeError
):
methods
=
[]
#
try
:
members
=
x
.
__members__
except
(
Nam
eError
,
TypeError
):
except
(
Attribut
eError
,
TypeError
):
members
=
[]
#
try
:
the_class
=
x
.
__class__
except
(
Nam
eError
,
TypeError
):
except
(
Attribut
eError
,
TypeError
):
the_class
=
None
#
try
:
bases
=
x
.
__bases__
except
(
Nam
eError
,
TypeError
):
except
(
Attribut
eError
,
TypeError
):
bases
=
()
#
total
=
dictkeys
+
methods
+
members
...
...
@@ -69,7 +69,7 @@ def is_function(x):
# Use a class method to make a function that can be called
# with or without arguments.
#
class
_dirclass
()
:
class
_dirclass
:
def
dir
(
args
):
if
type
(
args
)
=
type
(()):
return
listattrs
(
args
[
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