Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
34906550
Commit
34906550
authored
Jul 26, 2013
by
Terry Jan Reedy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #18539: Calltips now work for float default arguments.
parent
d5648ac3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletion
+9
-1
Lib/idlelib/CallTips.py
Lib/idlelib/CallTips.py
+1
-1
Lib/idlelib/idle_test/test_calltips.py
Lib/idlelib/idle_test/test_calltips.py
+6
-0
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/idlelib/CallTips.py
View file @
34906550
...
...
@@ -163,7 +163,7 @@ def get_arg_text(ob):
if
fob
.
func_code
.
co_flags
&
0x8
:
items
.
append
(
"***"
)
arg_text
=
", "
.
join
(
items
)
arg_text
=
"(%s)"
%
re
.
sub
(
"
\
.
\
d+"
,
"<tuple>"
,
arg_text
)
arg_text
=
"(%s)"
%
re
.
sub
(
"
(?<!
\
d)
\
.
\
d+
"
, "
<
tuple
>
", arg_text)
# See if we can use the docstring
doc = getattr(ob, "
__doc__
", "")
if doc:
...
...
Lib/idlelib/idle_test/test_calltips.py
View file @
34906550
...
...
@@ -10,5 +10,11 @@ class Test_get_entity(unittest.TestCase):
def
test_good_entity
(
self
):
self
.
assertIs
(
CTi
.
get_entity
(
'int'
),
int
)
class
Py2Test
(
unittest
.
TestCase
):
def
test_paramtuple_float
(
self
):
# 18539: (a,b) becomes '.0' in code object; change that but not float
def
f
((
a
,
b
),
c
=
0.0
):
pass
self
.
assertEqual
(
ct
.
get_arg_text
(
f
),
'(<tuple>, c=0.0)'
)
if
__name__
==
'__main__'
:
unittest
.
main
(
verbosity
=
2
,
exit
=
False
)
Misc/NEWS
View file @
34906550
...
...
@@ -104,6 +104,8 @@ IDLE
changed
when
it
has
not
been
changed
.
This
fix
followed
the
addition
of
a
test
file
originally
written
by
Phil
Webster
(
the
issue
's main goal).
- Issue #18539: Calltips now work for float default arguments.
- Issue #7136: In the Idle File menu, "New Window" is renamed "New File".
Patch by Tal Einat, Roget Serwy, and Todd Rovito.
...
...
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