This is done to compensate for the extra stack frames added by
IDLE itself, which cause problems when setting the recursion limit
to low values.
This wraps sys.setrecursionlimit() and sys.getrecursionlimit()
as invisibly as possible.
(cherry picked from commit fcf1d003bf)
Co-authored-by: Tal Einat <taleinat+github@gmail.com>
This commit is contained in:
Miss Islington (bot)2019-07-06 05:54:17 -07:00committed byGitHub
<spanid="format-menu"></span><h3>Format menu (Editor window only)<aclass="headerlink"href="#format-menu-editor-window-only"title="Permalink to this headline">¶</a></h3>
<dlclass="docutils">
<dt>Indent Region</dt>
<dd>Shift selected lines right by the indent width (default 4 spaces).</dd>
<dt>Dedent Region</dt>
<dd>Shift selected lines left by the indent width (default 4 spaces).</dd>
<dt>Comment Out Region</dt>
<dd>Insert ## in front of selected lines.</dd>
<dt>Uncomment Region</dt>
<dd>Remove leading # or ## from selected lines.</dd>
<dt>Tabify Region</dt>
<dd>Turn <em>leading</em> stretches of spaces into tabs. (Note: We recommend using
<dt>Indent Region</dt><dd>Shift selected lines right by the indent width (default 4 spaces).</dd>
<dt>Dedent Region</dt><dd>Shift selected lines left by the indent width (default 4 spaces).</dd>
<dt>Comment Out Region</dt><dd>Insert ## in front of selected lines.</dd>
<dt>Uncomment Region</dt><dd>Remove leading # or ## from selected lines.</dd>
<dt>Tabify Region</dt><dd>Turn <em>leading</em> stretches of spaces into tabs. (Note: We recommend using
4 space blocks to indent Python code.)</dd>
<dt>Untabify Region</dt>
<dd>Turn <em>all</em> tabs into the correct number of spaces.</dd>
<dt>Toggle Tabs</dt>
<dd>Open a dialog to switch between indenting with spaces and tabs.</dd>
<dt>New Indent Width</dt>
<dd>Open a dialog to change indent width. The accepted default by the Python
<dt>Untabify Region</dt><dd>Turn <em>all</em> tabs into the correct number of spaces.</dd>
<dt>Toggle Tabs</dt><dd>Open a dialog to switch between indenting with spaces and tabs.</dd>
<dt>New Indent Width</dt><dd>Open a dialog to change indent width. The accepted default by the Python
community is 4 spaces.</dd>
<dt>Format Paragraph</dt>
<dd>Reformat the current blank-line-delimited paragraph in comment block or
<dt>Format Paragraph</dt><dd>Reformat the current blank-line-delimited paragraph in comment block or
multiline string or selected line in a string. All lines in the
paragraph will be formatted to less than N columns, where N defaults to 72.</dd>
<dt>Strip trailing whitespace</dt>
<dd>Remove trailing space and other whitespace characters after the last
<dt>Strip trailing whitespace</dt><dd>Remove trailing space and other whitespace characters after the last
non-whitespace character of a line by applying str.rstrip to each line,
including lines within multiline strings.</dd>
</dl>
@ -249,20 +211,17 @@ including lines within multiline strings.</dd>
<spanid="index-2"></span><h3>Run menu (Editor window only)<aclass="headerlink"href="#run-menu-editor-window-only"title="Permalink to this headline">¶</a></h3>
<dlclass="docutils"id="python-shell">
<dt>Python Shell</dt>
<dd>Open or wake up the Python Shell window.</dd>
<dt>Python Shell</dt><dd>Open or wake up the Python Shell window.</dd>
</dl>
<dlclass="docutils"id="check-module">
<dt>Check Module</dt>
<dd>Check the syntax of the module currently open in the Editor window. If the
<dt>Check Module</dt><dd>Check the syntax of the module currently open in the Editor window. If the
module has not been saved IDLE will either prompt the user to save or
autosave, as selected in the General tab of the Idle Settings dialog. If
there is a syntax error, the approximate location is indicated in the
Editor window.</dd>
</dl>
<dlclass="docutils"id="run-module">
<dt>Run Module</dt>
<dd>Do <aclass="reference internal"href="#check-module"><spanclass="std std-ref">Check Module</span></a>. If no error, restart the shell to clean the
<dt>Run Module</dt><dd>Do <aclass="reference internal"href="#check-module"><spanclass="std std-ref">Check Module</span></a>. If no error, restart the shell to clean the
environment, then execute the module. Output is displayed in the Shell
window. Note that output requires use of <codeclass="docutils literal notranslate"><spanclass="pre">print</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">write</span></code>.
When execution is complete, the Shell retains focus and displays a prompt.
@ -271,8 +230,7 @@ This is similar to executing a file with <code class="docutils literal notransla
line.</dd>
</dl>
<dlclass="docutils"id="run-custom">
<dt>Run… Customized</dt>
<dd>Same as <aclass="reference internal"href="#run-module"><spanclass="std std-ref">Run Module</span></a>, but run the module with customized
<dt>Run… Customized</dt><dd>Same as <aclass="reference internal"href="#run-module"><spanclass="std std-ref">Run Module</span></a>, but run the module with customized
settings. <em>Command Line Arguments</em> extend <aclass="reference internal"href="sys.html#sys.argv"title="sys.argv"><codeclass="xref py py-data docutils literal notranslate"><spanclass="pre">sys.argv</span></code></a> as if passed
on a command line. The module can be run in the Shell without restarting.</dd>
</dl>
@ -280,56 +238,44 @@ on a command line. The module can be run in the Shell without restarting.</dd>
<h3>Help menu (Shell and Editor)<aclass="headerlink"href="#help-menu-shell-and-editor"title="Permalink to this headline">¶</a></h3>
<dlclass="docutils">
<dt>About IDLE</dt>
<dd>Display version, copyright, license, credits, and more.</dd>
<dt>IDLE Help</dt>
<dd>Display this IDLE document, detailing the menu options, basic editing and
<dt>About IDLE</dt><dd>Display version, copyright, license, credits, and more.</dd>
<dt>IDLE Help</dt><dd>Display this IDLE document, detailing the menu options, basic editing and
navigation, and other tips.</dd>
<dt>Python Docs</dt>
<dd>Access local Python documentation, if installed, or start a web browser
<dt>Python Docs</dt><dd>Access local Python documentation, if installed, or start a web browser
and open docs.python.org showing the latest Python documentation.</dd>
<dt>Turtle Demo</dt>
<dd>Run the turtledemo module with example Python code and turtle drawings.</dd>
<dt>Turtle Demo</dt><dd>Run the turtledemo module with example Python code and turtle drawings.</dd>
</dl>
<p>Additional help sources may be added here with the Configure IDLE dialog under
the General tab. See the <aclass="reference internal"href="#help-sources"><spanclass="std std-ref">Help sources</span></a> subsection below
@ -365,32 +307,25 @@ for more on Help menu choices.</p>
<p>Open a context menu by right-clicking in a window (Control-click on macOS).
Context menus have the standard clipboard functions also on the Edit menu.</p>
<dlclass="docutils">
<dt>Cut</dt>
<dd>Copy selection into the system-wide clipboard; then delete the selection.</dd>
<dt>Copy</dt>
<dd>Copy selection into the system-wide clipboard.</dd>
<dt>Paste</dt>
<dd>Insert contents of the system-wide clipboard into the current window.</dd>
<dt>Cut</dt><dd>Copy selection into the system-wide clipboard; then delete the selection.</dd>
<dt>Copy</dt><dd>Copy selection into the system-wide clipboard.</dd>
<dt>Paste</dt><dd>Insert contents of the system-wide clipboard into the current window.</dd>
</dl>
<p>Editor windows also have breakpoint functions. Lines with a breakpoint set are
specially marked. Breakpoints only have an effect when running under the
debugger. Breakpoints for a file are saved in the user’s .idlerc directory.</p>
<dlclass="docutils">
<dt>Set Breakpoint</dt>
<dd>Set a breakpoint on the current line.</dd>
<dt>Clear Breakpoint</dt>
<dd>Clear the breakpoint on that line.</dd>
<dt>Set Breakpoint</dt><dd>Set a breakpoint on the current line.</dd>
<dt>Clear Breakpoint</dt><dd>Clear the breakpoint on that line.</dd>
</dl>
<p>Shell and Output windows also have the following.</p>
<dlclass="docutils">
<dt>Go to file/line</dt>
<dd>Same as in Debug menu.</dd>
<dt>Go to file/line</dt><dd>Same as in Debug menu.</dd>
</dl>
<p>The Shell window also has an output squeezing facility explained in the <em>Python
Shell window</em> subsection below.</p>
<dlclass="docutils">
<dt>Squeeze</dt>
<dd>If the cursor is over an output line, squeeze all the output between
<dt>Squeeze</dt><dd>If the cursor is over an output line, squeeze all the output between
the code above and the prompt below down to a ‘Squeezed text’ label.</dd>
</dl>
</div>
@ -670,6 +605,9 @@ such as multiprocessing. If such subprocess use <code class="docutils literal n
or <codeclass="docutils literal notranslate"><spanclass="pre">print</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">write</span></code> to sys.stdout or sys.stderr,
IDLE should be started in a command line window. The secondary subprocess
will then be attached to that window for input and output.</p>
<p>The IDLE code running in the execution process adds frames to the call stack
that would not be there otherwise. IDLE wraps <codeclass="docutils literal notranslate"><spanclass="pre">sys.getrecursionlimit</span></code> and
<codeclass="docutils literal notranslate"><spanclass="pre">sys.setrecursionlimit</span></code> to reduce their visibility.</p>
<p>If <codeclass="docutils literal notranslate"><spanclass="pre">sys</span></code> is reset by user code, such as with <codeclass="docutils literal notranslate"><spanclass="pre">importlib.reload(sys)</span></code>,
IDLE’s changes are lost and input from the keyboard and output to the screen
will not work correctly.</p>
@ -772,7 +710,7 @@ re-import any specific items (e.g. from foo import baz) if the changes
are to take effect. For these reasons, it is preferable to run IDLE
with the default subprocess if at all possible.</p>
<divclass="deprecated">
<p><spanclass="versionmodified">Deprecated since version 3.4.</span></p>
<p><spanclass="versionmodified deprecated">Deprecated since version 3.4.</span></p>