py-ast - v1.16.0
    Preparing search index...

    Interface Constant

    A literal constant: string, number, boolean, None, bytes, complex, tuple of constants, or Ellipsis.

    interface Constant {
        inlineComment?: Comment;
        lineno: number;
        col_offset: number;
        end_lineno?: number;
        end_col_offset?: number;
        nodeType: "Constant";
        value: any;
        kind?: string;
        quote_style?: string;
    }

    Hierarchy (View Summary)

    Index
    inlineComment?: Comment

    Optional inline comment attached to this node.

    lineno: number

    1-indexed source line the node starts on.

    col_offset: number

    0-indexed byte offset (UTF-8) within lineno where the node starts.

    end_lineno?: number

    1-indexed source line the node ends on.

    end_col_offset?: number

    0-indexed byte offset (UTF-8) within end_lineno where the node ends.

    nodeType: "Constant"
    value: any
    kind?: string

    "u" for a u"..."/U"..." string literal, matching CPython's ast.Constant.kind; absent for every other literal (including plain, raw, byte, and f/t-string constants — CPython's kind never holds anything but "u" or None).

    quote_style?: string

    Original prefix+quote text of a string literal, e.g. ", ''', rb". A py-ast extension (not part of CPython's ast.Constant) kept so the unparser can round-trip the exact original quote style; not set on non-string constants or on nodes that weren't produced by this library's parser.