Twisted
Home FAQ Docs Download Timeline Roadmap View Tickets Search
module documentation

Undocumented

Class AfterCommentParser Python source code parser to pick up comment after assignment.
Class Token Better token wrapper for tokenize module.
Class TokenProcessor Processes tokens from source code lines.
Function extract_doc_comment_after Support for doc comment as found in sphinx.
Function extract_doc_comment_before Same as extract_doc_comment_after but fetch the comment before the assignment.
Variable comment_re Undocumented
Variable indent_re Undocumented
def extract_doc_comment_after(node: ast.Assign | ast.AnnAssign, lines: Sequence[str]) -> tuple[int, str] | None: (source)

Support for doc comment as found in sphinx.

Parameters
node:ast.Assign | ast.AnnAssignthe assignment node
lines:Sequence[str]the lines of the source code of the module, as generated by code.splitlines(keepends=True).
Returns
tuple[int, str] | NoneA tuple linenumber, docstring or None if the assignment doesn't have a doc comment.
def extract_doc_comment_before(node: ast.Assign | ast.AnnAssign, lines: Sequence[str]) -> tuple[int, str] | None: (source)

Same as extract_doc_comment_after but fetch the comment before the assignment.

comment_re = (source)

Undocumented

indent_re = (source)

Undocumented