summaryrefslogtreecommitdiff
path: root/devdocs/python~3.12/library%2Ftabnanny.html
diff options
context:
space:
mode:
Diffstat (limited to 'devdocs/python~3.12/library%2Ftabnanny.html')
-rw-r--r--devdocs/python~3.12/library%2Ftabnanny.html25
1 files changed, 25 insertions, 0 deletions
diff --git a/devdocs/python~3.12/library%2Ftabnanny.html b/devdocs/python~3.12/library%2Ftabnanny.html
new file mode 100644
index 00000000..3e2e5e73
--- /dev/null
+++ b/devdocs/python~3.12/library%2Ftabnanny.html
@@ -0,0 +1,25 @@
+ <span id="tabnanny-detection-of-ambiguous-indentation"></span><h1>tabnanny — Detection of ambiguous indentation</h1> <p><strong>Source code:</strong> <a class="reference external" href="https://github.com/python/cpython/tree/3.12/Lib/tabnanny.py">Lib/tabnanny.py</a></p> <p>For the time being this module is intended to be called as a script. However it is possible to import it into an IDE and use the function <a class="reference internal" href="#tabnanny.check" title="tabnanny.check"><code>check()</code></a> described below.</p> <div class="admonition note"> <p class="admonition-title">Note</p> <p>The API provided by this module is likely to change in future releases; such changes may not be backward compatible.</p> </div> <dl class="py function"> <dt class="sig sig-object py" id="tabnanny.check">
+<code>tabnanny.check(file_or_dir)</code> </dt> <dd>
+<p>If <em>file_or_dir</em> is a directory and not a symbolic link, then recursively descend the directory tree named by <em>file_or_dir</em>, checking all <code>.py</code> files along the way. If <em>file_or_dir</em> is an ordinary Python source file, it is checked for whitespace related problems. The diagnostic messages are written to standard output using the <a class="reference internal" href="functions#print" title="print"><code>print()</code></a> function.</p> </dd>
+</dl> <dl class="py data"> <dt class="sig sig-object py" id="tabnanny.verbose">
+<code>tabnanny.verbose</code> </dt> <dd>
+<p>Flag indicating whether to print verbose messages. This is incremented by the <code>-v</code> option if called as a script.</p> </dd>
+</dl> <dl class="py data"> <dt class="sig sig-object py" id="tabnanny.filename_only">
+<code>tabnanny.filename_only</code> </dt> <dd>
+<p>Flag indicating whether to print only the filenames of files containing whitespace related problems. This is set to true by the <code>-q</code> option if called as a script.</p> </dd>
+</dl> <dl class="py exception"> <dt class="sig sig-object py" id="tabnanny.NannyNag">
+<code>exception tabnanny.NannyNag</code> </dt> <dd>
+<p>Raised by <a class="reference internal" href="#tabnanny.process_tokens" title="tabnanny.process_tokens"><code>process_tokens()</code></a> if detecting an ambiguous indent. Captured and handled in <a class="reference internal" href="#tabnanny.check" title="tabnanny.check"><code>check()</code></a>.</p> </dd>
+</dl> <dl class="py function"> <dt class="sig sig-object py" id="tabnanny.process_tokens">
+<code>tabnanny.process_tokens(tokens)</code> </dt> <dd>
+<p>This function is used by <a class="reference internal" href="#tabnanny.check" title="tabnanny.check"><code>check()</code></a> to process tokens generated by the <a class="reference internal" href="tokenize#module-tokenize" title="tokenize: Lexical scanner for Python source code."><code>tokenize</code></a> module.</p> </dd>
+</dl> <div class="admonition seealso"> <p class="admonition-title">See also</p> <dl class="simple"> <dt>
+<code>Module</code> <a class="reference internal" href="tokenize#module-tokenize" title="tokenize: Lexical scanner for Python source code."><code>tokenize</code></a>
+</dt>
+<dd>
+<p>Lexical scanner for Python source code.</p> </dd> </dl> </div> <div class="_attribution">
+ <p class="_attribution-p">
+ &copy; 2001&ndash;2023 Python Software Foundation<br>Licensed under the PSF License.<br>
+ <a href="https://docs.python.org/3.12/library/tabnanny.html" class="_attribution-link">https://docs.python.org/3.12/library/tabnanny.html</a>
+ </p>
+</div>