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
a317eef8
Kaydet (Commit)
a317eef8
authored
Haz 03, 2012
tarafından
Terry Jan Reedy
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge with 3.2 #12510
üst
11cfea92
e606e238
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
15 deletions
+17
-15
CallTips.py
Lib/idlelib/CallTips.py
+17
-15
No files found.
Lib/idlelib/CallTips.py
Dosyayı görüntüle @
a317eef8
...
...
@@ -67,18 +67,18 @@ class CallTips:
if
not
sur_paren
:
return
hp
.
set_index
(
sur_paren
[
0
])
name
=
hp
.
get_expression
()
if
not
name
:
expression
=
hp
.
get_expression
()
if
not
expression
:
return
if
not
evalfuncs
and
(
name
.
find
(
'('
)
!=
-
1
):
if
not
evalfuncs
and
(
expression
.
find
(
'('
)
!=
-
1
):
return
argspec
=
self
.
fetch_tip
(
name
)
argspec
=
self
.
fetch_tip
(
expression
)
if
not
argspec
:
return
self
.
active_calltip
=
self
.
_calltip_window
()
self
.
active_calltip
.
showtip
(
argspec
,
sur_paren
[
0
],
sur_paren
[
1
])
def
fetch_tip
(
self
,
name
):
def
fetch_tip
(
self
,
expression
):
"""Return the argument list and docstring of a function or class.
If there is a Python subprocess, get the calltip there. Otherwise,
...
...
@@ -94,25 +94,27 @@ class CallTips:
"""
try
:
rpcclt
=
self
.
editwin
.
flist
.
pyshell
.
interp
.
rpcclt
except
:
except
AttributeError
:
rpcclt
=
None
if
rpcclt
:
return
rpcclt
.
remotecall
(
"exec"
,
"get_the_calltip"
,
(
name
,),
{})
(
expression
,),
{})
else
:
entity
=
self
.
get_entity
(
name
)
entity
=
self
.
get_entity
(
expression
)
return
get_argspec
(
entity
)
def
get_entity
(
self
,
name
):
"Lookup name in a namespace spanning sys.modules and __main.dict__."
if
name
:
def
get_entity
(
self
,
expression
):
"""Return the object corresponding to expression evaluated
in a namespace spanning sys.modules and __main.dict__.
"""
if
expression
:
namespace
=
sys
.
modules
.
copy
()
namespace
.
update
(
__main__
.
__dict__
)
try
:
return
eval
(
name
,
namespace
)
# any exception is possible if evalfuncs True in open_calltip
#
at least Syntax, Name, Attribute, Index, and Key E. if not
except
:
return
eval
(
expression
,
namespace
)
except
BaseException
:
#
An uncaught exception closes idle, and eval can raise any
# exception, especially if user classes are involved.
return
None
def
_find_constructor
(
class_ob
):
...
...
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