On this page
tabnanny.NannyNag
Prev: tabnanny.check | Up: tabnanny | Next: tabnanny.process_tokens
Rel: tabnanny.check, tabnanny.process_tokens
Ref: docs.python.org — tabnanny.NannyNag
Tags: #public #python3 #stdlib #tabnanny
Import
import tabnanny
from tabnanny import NannyNag
Signature & Overview
tabnanny.NannyNag(lineno, msg, line)
Raised by process_tokens() if detecting an ambiguous indent.
Methods & Attributes
NannyNag.add_note(self, note, /)— Add a note to the exceptionNannyNag.get_line(self)—NannyNag.get_linemethod/property.NannyNag.get_lineno(self)—NannyNag.get_linenomethod/property.NannyNag.get_msg(self)—NannyNag.get_msgmethod/property.NannyNag.with_traceback(self, tb, /)— Set self.traceback to tb and return self.
Usage
import tabnanny
assert issubclass(tabnanny.NannyNag, Exception)
Gotchas
- Internal exception raised by
process_tokens()when ambiguous tab/space indentation is found.
REPL Inspect
from tabnanny import NannyNag
help(NannyNag)
Linked from
Related notes
- tuts/python3/stdlib_module/tabnanny/check 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