From 37f81355b0bd1b7f7b23a7efdf3267d691160669 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Tue, 29 Sep 2015 01:55:57 -0400 Subject: Issue #24028: Add subsection about Idle calltips. --- Doc/library/idle.rst | 32 +++++++++++++++++++++++++++++--- Lib/idlelib/help.html | 38 ++++++++++++++++++++++++++++++-------- 2 files changed, 59 insertions(+), 11 deletions(-) diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index 0634e54..9ed673f 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -435,9 +435,35 @@ Note that IDLE itself places quite a few modules in sys.modules, so much can be found by default, e.g. the re module. If you don't like the ACW popping up unbidden, simply make the delay -longer or disable the extension. Or another option is the delay could -be set to zero. Another alternative to preventing ACW popups is to -disable the call tips extension. +longer or disable the extension. + +Calltips +^^^^^^^^ + +A calltip is shown when one types :kbd:`(` after the name of an *acccessible* +function. A name expression may include dots and subscripts. A calltip +remains until it is clicked, the cursor is moved out of the argument area, +or :kbd:`)` is typed. When the cursor is in the argument part of a definition, +the menu or shortcut display a calltip. + +A calltip consists of the function signature and the first line of the +docstring. For builtins without an accessible signature, the calltip +consists of all lines up the fifth line or the first blank line. These +details may change. + +The set of *accessible* functions depends on what modules have been imported +into the user process, including those imported by Idle itself, +and what definitions have been run, all since the last restart. + +For example, restart the Shell and enter ``itertools.count(``. A calltip +appears because Idle imports itertools into the user process for its own use. +(This could change.) Enter ``turtle.write(`` and nothing appears. Idle does +not import turtle. The menu or shortcut do nothing either. Enter +``import turtle`` and then ``turtle.write(`` will work. + +In an editor, import statements have no effect until one runs the file. One +might want to run a file after writing the import statements at the top, +or immediately run an existing file before editing. Python Shell window ^^^^^^^^^^^^^^^^^^^ diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index 053828f..1cc5173 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -417,12 +417,33 @@ not be found. Run the module once with your imports to correct this situation. Note that IDLE itself places quite a few modules in sys.modules, so much can be found by default, e.g. the re module.

If you don’t like the ACW popping up unbidden, simply make the delay -longer or disable the extension. Or another option is the delay could -be set to zero. Another alternative to preventing ACW popups is to -disable the call tips extension.

+longer or disable the extension.

+ +
+

25.5.2.3. Calltips

+

A calltip is shown when one types ( after the name of an acccessible +function. A name expression may include dots and subscripts. A calltip +remains until it is clicked, the cursor is moved out of the argument area, +or ) is typed. When the cursor is in the argument part of a definition, +the menu or shortcut display a calltip.

+

A calltip consists of the function signature and the first line of the +docstring. For builtins without an accessible signature, the calltip +consists of all lines up the fifth line or the first blank line. These +details may change.

+

The set of accessible functions depends on what modules have been imported +into the user process, including those imported by Idle itself, +and what definitions have been run, all since the last restart.

+

For example, restart the Shell and enter itertools.count(. A calltip +appears because Idle imports itertools into the user process for its own use. +(This could change.) Enter turtle.write( and nothing appears. Idle does +not import turtle. The menu or shortcut do nothing either. Enter +import turtle and then turtle.write( will work.

+

In an editor, import statements have no effect until one runs the file. One +might want to run a file after writing the import statements at the top, +or immediately run an existing file before editing.

-

25.5.2.3. Python Shell window

+

25.5.2.4. Python Shell window

-

25.5.2.4. Text colors

+

25.5.2.5. Text colors

Idle defaults to black on white text, but colors text with special meanings. For the shell, these are shell output, shell error, user output, and user error. For Python code, at the shell prompt or in an editor, these are @@ -595,8 +616,9 @@ are currently:

  • 25.5.2. Editing and navigation
  • 25.5.3. Startup and code execution
      @@ -677,7 +699,7 @@ are currently:

      The Python Software Foundation is a non-profit corporation. Please donate.
      - Last updated on Sep 24, 2015. + Last updated on Sep 29, 2015. Found a bug?
      Created using Sphinx 1.2.3. -- cgit v0.12