On this page
tabnanny.check
Up: tabnanny | Next: tabnanny.NannyNag
Rel: tabnanny.NannyNag, tabnanny.process_tokens
Ref: docs.python.org — tabnanny.check
Tags: #public #python3 #stdlib #tabnanny
Import
import tabnanny
from tabnanny import check
Signature & Overview
tabnanny.check(file)
If file_or_dir is a directory and not a symbolic link, then recursively descend the directory tree named by file_or_dir, checking all .py files along the way. If file_or_dir is an ordinary Python source file, it is
Usage
from pathlib import Path
import tabnanny, tempfile
with tempfile.TemporaryDirectory() as tmp:
p = Path(tmp) / 'clean.py'
p.write_text('def f():\n return 1\n', encoding='utf-8')
tabnanny.check(str(p))
Gotchas
- Prints findings to stdout rather than returning a boolean.
REPL Inspect
from tabnanny import check
help(check)
Linked from
Related notes
- tuts/python3/stdlib_module/tabnanny/NannyNag Linked here; links to this page; shared tags: #stdlib, #tabnanny
- tuts/python3/stdlib_module/tabnanny/process_tokens Linked here; links to this page; shared tags: #stdlib, #tabnanny
- tuts/python3/stdlib_module/tabnanny Linked here; links to this page; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib
- tuts/c/stdlib/assert/static_assert shared tags: #stdlib
- tuts/c/stdlib/ctype shared tags: #stdlib
- tuts/c/stdlib/ctype/isalpha shared tags: #stdlib
- tuts/c/stdlib/ctype/isdigit shared tags: #stdlib