bpo-35764: Rewrite the IDLE Calltips doc section (GH-22363) · xzy3/cpython@cdeddcb · GitHub
Skip to content

Commit cdeddcb

Browse files
terryjreedyxzy3-cdc
authored andcommitted
bpo-35764: Rewrite the IDLE Calltips doc section (pythonGH-22363)
1 parent be70ace commit cdeddcb

4 files changed

Lines changed: 51 additions & 42 deletions

File tree

Doc/library/idle.rst

Lines changed: 25 additions & 22 deletions

Lib/idlelib/NEWS.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ Released on 2020-10-05?
33
======================================
44

55

6+
bpo-35764: Rewrite the Calltips doc section.
7+
68
bpo-40181: In calltips, stop reminding that '/' marks the end of
79
positional-only arguments.
810

Lib/idlelib/help.html

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -509,26 +509,29 @@ <h3>Automatic indentation<a class="headerlink" href="#automatic-indentation" tit
509509
</div>
510510
<div class="section" id="calltips">
511511
<span id="id4"></span><h3>Calltips<a class="headerlink" href="#calltips" title="Permalink to this headline"></a></h3>
512-
<p>A calltip is shown when one types <kbd class="kbd docutils literal notranslate">(</kbd> after the name of an <em>accessible</em>
513-
function. A name expression may include dots and subscripts. A calltip
514-
remains until it is clicked, the cursor is moved out of the argument area,
515-
or <kbd class="kbd docutils literal notranslate">)</kbd> is typed. When the cursor is in the argument part of a definition,
516-
the menu or shortcut display a calltip.</p>
517-
<p>A calltip consists of the function signature and the first line of the
518-
docstring. For builtins without an accessible signature, the calltip
519-
consists of all lines up the fifth line or the first blank line. These
520-
details may change.</p>
521-
<p>The set of <em>accessible</em> functions depends on what modules have been imported
522-
into the user process, including those imported by Idle itself,
523-
and what definitions have been run, all since the last restart.</p>
512+
<p>A calltip is shown automatically when one types <kbd class="kbd docutils literal notranslate">(</kbd> after the name
513+
of an <em>accessible</em> function. A function name expression may include
514+
dots and subscripts. A calltip remains until it is clicked, the cursor
515+
is moved out of the argument area, or <kbd class="kbd docutils literal notranslate">)</kbd> is typed. Whenever the
516+
cursor is in the argument part of a definition, select Edit and “Show
517+
Call Tip” on the menu or enter its shortcut to display a calltip.</p>
518+
<p>The calltip consists of the function’s signature and docstring up to
519+
the latter’s first blank line or the fifth non-blank line. (Some builtin
520+
functions lack an accessible signature.) A ‘/’ or ‘*’ in the signature
521+
indicates that the preceding or following arguments are passed by
522+
position or name (keyword) only. Details are subject to change.</p>
523+
<p>In Shell, the accessible functions depends on what modules have been
524+
imported into the user process, including those imported by Idle itself,
525+
and which definitions have been run, all since the last restart.</p>
524526
<p>For example, restart the Shell and enter <code class="docutils literal notranslate"><span class="pre">itertools.count(</span></code>. A calltip
525-
appears because Idle imports itertools into the user process for its own use.
526-
(This could change.) Enter <code class="docutils literal notranslate"><span class="pre">turtle.write(</span></code> and nothing appears. Idle does
527-
not import turtle. The menu or shortcut do nothing either. Enter
528-
<code class="docutils literal notranslate"><span class="pre">import</span> <span class="pre">turtle</span></code> and then <code class="docutils literal notranslate"><span class="pre">turtle.write(</span></code> will work.</p>
529-
<p>In an editor, import statements have no effect until one runs the file. One
530-
might want to run a file after writing the import statements at the top,
531-
or immediately run an existing file before editing.</p>
527+
appears because Idle imports itertools into the user process for its own
528+
use. (This could change.) Enter <code class="docutils literal notranslate"><span class="pre">turtle.write(</span></code> and nothing appears.
529+
Idle does not itself import turtle. The menu entry and shortcut also do
530+
nothing. Enter <code class="docutils literal notranslate"><span class="pre">import</span> <span class="pre">turtle</span></code>. Thereafter, <code class="docutils literal notranslate"><span class="pre">turtle.write(</span></code>
531+
will display a calltip.</p>
532+
<p>In an editor, import statements have no effect until one runs the file.
533+
One might want to run a file after writing import statements, after
534+
adding function definitions, or after opening an existing file.</p>
532535
</div>
533536
<div class="section" id="code-context">
534537
<span id="id5"></span><h3>Code Context<a class="headerlink" href="#code-context" title="Permalink to this headline"></a></h3>
@@ -975,7 +978,7 @@ <h3>Navigation</h3>
975978
<br />
976979
<br />
977980

978-
Last updated on Sep 09, 2020.
981+
Last updated on Sep 22, 2020.
979982
<a href="https://docs.python.org/3/bugs.html">Found a bug</a>?
980983
<br />
981984

Lines changed: 1 addition & 0 deletions

0 commit comments

Comments
 (0)