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
de055999
Kaydet (Commit)
de055999
authored
Eki 09, 2009
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
replace callable()
üst
0c8bee63
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
18 deletions
+18
-18
dist.py
Lib/distutils/dist.py
+1
-1
__init__.py
Lib/encodings/__init__.py
+6
-6
rpc.py
Lib/idlelib/rpc.py
+2
-2
imputil.py
Lib/imputil.py
+2
-2
Tix.py
Lib/lib-tk/Tix.py
+1
-1
Tkinter.py
Lib/lib-tk/Tkinter.py
+3
-3
timeit.py
Lib/timeit.py
+3
-3
No files found.
Lib/distutils/dist.py
Dosyayı görüntüle @
de055999
...
@@ -545,7 +545,7 @@ Common commands: (see '--help-commands' for more)
...
@@ -545,7 +545,7 @@ Common commands: (see '--help-commands' for more)
for
(
help_option
,
short
,
desc
,
func
)
in
cmd_class
.
help_options
:
for
(
help_option
,
short
,
desc
,
func
)
in
cmd_class
.
help_options
:
if
hasattr
(
opts
,
parser
.
get_attr_name
(
help_option
)):
if
hasattr
(
opts
,
parser
.
get_attr_name
(
help_option
)):
help_option_found
=
1
help_option_found
=
1
if
callable
(
func
):
if
hasattr
(
func
,
'__call__'
):
func
()
func
()
else
:
else
:
raise
DistutilsClassError
(
raise
DistutilsClassError
(
...
...
Lib/encodings/__init__.py
Dosyayı görüntüle @
de055999
...
@@ -123,12 +123,12 @@ def search_function(encoding):
...
@@ -123,12 +123,12 @@ def search_function(encoding):
raise
CodecRegistryError
,
\
raise
CodecRegistryError
,
\
'module "
%
s" (
%
s) failed to register'
%
\
'module "
%
s" (
%
s) failed to register'
%
\
(
mod
.
__name__
,
mod
.
__file__
)
(
mod
.
__name__
,
mod
.
__file__
)
if
not
callable
(
entry
[
0
]
)
or
\
if
not
hasattr
(
entry
[
0
],
'__call__'
)
or
\
not
callable
(
entry
[
1
]
)
or
\
not
hasattr
(
entry
[
1
],
'__call__'
)
or
\
(
entry
[
2
]
is
not
None
and
not
callable
(
entry
[
2
]
))
or
\
(
entry
[
2
]
is
not
None
and
not
hasattr
(
entry
[
2
],
'__call__'
))
or
\
(
entry
[
3
]
is
not
None
and
not
callable
(
entry
[
3
]
))
or
\
(
entry
[
3
]
is
not
None
and
not
hasattr
(
entry
[
3
],
'__call__'
))
or
\
(
len
(
entry
)
>
4
and
entry
[
4
]
is
not
None
and
not
callable
(
entry
[
4
]
))
or
\
(
len
(
entry
)
>
4
and
entry
[
4
]
is
not
None
and
not
hasattr
(
entry
[
4
],
'__call__'
))
or
\
(
len
(
entry
)
>
5
and
entry
[
5
]
is
not
None
and
not
callable
(
entry
[
5
]
)):
(
len
(
entry
)
>
5
and
entry
[
5
]
is
not
None
and
not
hasattr
(
entry
[
5
],
'__call__'
)):
raise
CodecRegistryError
,
\
raise
CodecRegistryError
,
\
'incompatible codecs in module "
%
s" (
%
s)'
%
\
'incompatible codecs in module "
%
s" (
%
s)'
%
\
(
mod
.
__name__
,
mod
.
__file__
)
(
mod
.
__name__
,
mod
.
__file__
)
...
...
Lib/idlelib/rpc.py
Dosyayı görüntüle @
de055999
...
@@ -570,7 +570,7 @@ def _getmethods(obj, methods):
...
@@ -570,7 +570,7 @@ def _getmethods(obj, methods):
# Adds names to dictionary argument 'methods'
# Adds names to dictionary argument 'methods'
for
name
in
dir
(
obj
):
for
name
in
dir
(
obj
):
attr
=
getattr
(
obj
,
name
)
attr
=
getattr
(
obj
,
name
)
if
callable
(
attr
):
if
hasattr
(
attr
,
'__call__'
):
methods
[
name
]
=
1
methods
[
name
]
=
1
if
type
(
obj
)
==
types
.
InstanceType
:
if
type
(
obj
)
==
types
.
InstanceType
:
_getmethods
(
obj
.
__class__
,
methods
)
_getmethods
(
obj
.
__class__
,
methods
)
...
@@ -581,7 +581,7 @@ def _getmethods(obj, methods):
...
@@ -581,7 +581,7 @@ def _getmethods(obj, methods):
def
_getattributes
(
obj
,
attributes
):
def
_getattributes
(
obj
,
attributes
):
for
name
in
dir
(
obj
):
for
name
in
dir
(
obj
):
attr
=
getattr
(
obj
,
name
)
attr
=
getattr
(
obj
,
name
)
if
not
callable
(
attr
):
if
not
hasattr
(
attr
,
'__call__'
):
attributes
[
name
]
=
1
attributes
[
name
]
=
1
class
MethodProxy
(
object
):
class
MethodProxy
(
object
):
...
...
Lib/imputil.py
Dosyayı görüntüle @
de055999
...
@@ -51,7 +51,7 @@ class ImportManager:
...
@@ -51,7 +51,7 @@ class ImportManager:
self
.
namespace
[
'__import__'
]
=
self
.
previous_importer
self
.
namespace
[
'__import__'
]
=
self
.
previous_importer
def
add_suffix
(
self
,
suffix
,
importFunc
):
def
add_suffix
(
self
,
suffix
,
importFunc
):
assert
callable
(
importFunc
)
assert
hasattr
(
importFunc
,
'__call__'
)
self
.
fs_imp
.
add_suffix
(
suffix
,
importFunc
)
self
.
fs_imp
.
add_suffix
(
suffix
,
importFunc
)
######################################################################
######################################################################
...
@@ -539,7 +539,7 @@ class _FilesystemImporter(Importer):
...
@@ -539,7 +539,7 @@ class _FilesystemImporter(Importer):
self
.
suffixes
=
[
]
self
.
suffixes
=
[
]
def
add_suffix
(
self
,
suffix
,
importFunc
):
def
add_suffix
(
self
,
suffix
,
importFunc
):
assert
callable
(
importFunc
)
assert
hasattr
(
importFunc
,
'__call__'
)
self
.
suffixes
.
append
((
suffix
,
importFunc
))
self
.
suffixes
.
append
((
suffix
,
importFunc
))
def
import_from_dir
(
self
,
dir
,
fqname
):
def
import_from_dir
(
self
,
dir
,
fqname
):
...
...
Lib/lib-tk/Tix.py
Dosyayı görüntüle @
de055999
...
@@ -405,7 +405,7 @@ class TixWidget(Tkinter.Widget):
...
@@ -405,7 +405,7 @@ class TixWidget(Tkinter.Widget):
elif
kw
:
cnf
=
kw
elif
kw
:
cnf
=
kw
options
=
()
options
=
()
for
k
,
v
in
cnf
.
items
():
for
k
,
v
in
cnf
.
items
():
if
callable
(
v
):
if
hasattr
(
v
,
'__call__'
):
v
=
self
.
_register
(
v
)
v
=
self
.
_register
(
v
)
options
=
options
+
(
'-'
+
k
,
v
)
options
=
options
+
(
'-'
+
k
,
v
)
return
master
.
tk
.
call
((
'image'
,
'create'
,
imgtype
,)
+
options
)
return
master
.
tk
.
call
((
'image'
,
'create'
,
imgtype
,)
+
options
)
...
...
Lib/lib-tk/Tkinter.py
Dosyayı görüntüle @
de055999
...
@@ -1047,7 +1047,7 @@ class Misc:
...
@@ -1047,7 +1047,7 @@ class Misc:
for
k
,
v
in
cnf
.
items
():
for
k
,
v
in
cnf
.
items
():
if
v
is
not
None
:
if
v
is
not
None
:
if
k
[
-
1
]
==
'_'
:
k
=
k
[:
-
1
]
if
k
[
-
1
]
==
'_'
:
k
=
k
[:
-
1
]
if
callable
(
v
):
if
hasattr
(
v
,
'__call__'
):
v
=
self
.
_register
(
v
)
v
=
self
.
_register
(
v
)
elif
isinstance
(
v
,
(
tuple
,
list
)):
elif
isinstance
(
v
,
(
tuple
,
list
)):
nv
=
[]
nv
=
[]
...
@@ -3194,7 +3194,7 @@ class Image:
...
@@ -3194,7 +3194,7 @@ class Image:
elif
kw
:
cnf
=
kw
elif
kw
:
cnf
=
kw
options
=
()
options
=
()
for
k
,
v
in
cnf
.
items
():
for
k
,
v
in
cnf
.
items
():
if
callable
(
v
):
if
hasattr
(
v
,
'__call__'
):
v
=
self
.
_register
(
v
)
v
=
self
.
_register
(
v
)
options
=
options
+
(
'-'
+
k
,
v
)
options
=
options
+
(
'-'
+
k
,
v
)
self
.
tk
.
call
((
'image'
,
'create'
,
imgtype
,
name
,)
+
options
)
self
.
tk
.
call
((
'image'
,
'create'
,
imgtype
,
name
,)
+
options
)
...
@@ -3217,7 +3217,7 @@ class Image:
...
@@ -3217,7 +3217,7 @@ class Image:
for
k
,
v
in
_cnfmerge
(
kw
)
.
items
():
for
k
,
v
in
_cnfmerge
(
kw
)
.
items
():
if
v
is
not
None
:
if
v
is
not
None
:
if
k
[
-
1
]
==
'_'
:
k
=
k
[:
-
1
]
if
k
[
-
1
]
==
'_'
:
k
=
k
[:
-
1
]
if
callable
(
v
):
if
hasattr
(
v
,
'__call__'
):
v
=
self
.
_register
(
v
)
v
=
self
.
_register
(
v
)
res
=
res
+
(
'-'
+
k
,
v
)
res
=
res
+
(
'-'
+
k
,
v
)
self
.
tk
.
call
((
self
.
name
,
'config'
)
+
res
)
self
.
tk
.
call
((
self
.
name
,
'config'
)
+
res
)
...
...
Lib/timeit.py
Dosyayı görüntüle @
de055999
...
@@ -126,7 +126,7 @@ class Timer:
...
@@ -126,7 +126,7 @@ class Timer:
if
isinstance
(
setup
,
basestring
):
if
isinstance
(
setup
,
basestring
):
setup
=
reindent
(
setup
,
4
)
setup
=
reindent
(
setup
,
4
)
src
=
template
%
{
'stmt'
:
stmt
,
'setup'
:
setup
}
src
=
template
%
{
'stmt'
:
stmt
,
'setup'
:
setup
}
elif
callable
(
setup
):
elif
hasattr
(
setup
,
'__call__'
):
src
=
template
%
{
'stmt'
:
stmt
,
'setup'
:
'_setup()'
}
src
=
template
%
{
'stmt'
:
stmt
,
'setup'
:
'_setup()'
}
ns
[
'_setup'
]
=
setup
ns
[
'_setup'
]
=
setup
else
:
else
:
...
@@ -135,13 +135,13 @@ class Timer:
...
@@ -135,13 +135,13 @@ class Timer:
code
=
compile
(
src
,
dummy_src_name
,
"exec"
)
code
=
compile
(
src
,
dummy_src_name
,
"exec"
)
exec
code
in
globals
(),
ns
exec
code
in
globals
(),
ns
self
.
inner
=
ns
[
"inner"
]
self
.
inner
=
ns
[
"inner"
]
elif
callable
(
stmt
):
elif
hasattr
(
stmt
,
'__call__'
):
self
.
src
=
None
self
.
src
=
None
if
isinstance
(
setup
,
basestring
):
if
isinstance
(
setup
,
basestring
):
_setup
=
setup
_setup
=
setup
def
setup
():
def
setup
():
exec
_setup
in
globals
(),
ns
exec
_setup
in
globals
(),
ns
elif
not
callable
(
setup
):
elif
not
hasattr
(
setup
,
'__call__'
):
raise
ValueError
(
"setup is neither a string nor callable"
)
raise
ValueError
(
"setup is neither a string nor callable"
)
self
.
inner
=
_template_func
(
setup
,
stmt
)
self
.
inner
=
_template_func
(
setup
,
stmt
)
else
:
else
:
...
...
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