• Home
  • Raw
  • Download

Lines Matching +full:misleading +full:- +full:indentation

1 :mod:`ast` --- Abstract Syntax Trees
16 --------------
24 a flag to the :func:`compile` built-in function, or using the :func:`parse`
27 compiled into a Python code object using the built-in :func:`compile` function.
30 .. _abstract-grammar:
33 ----------------
42 ------------
48 :ref:`above <abstract-grammar>`. They are defined in the :mod:`_ast` C
49 module and re-exported in :mod:`ast`.
51 There is one class defined for each left-hand side symbol in the abstract
53 there is one class defined for each constructor on the right-hand side; these
54 classes inherit from the classes for the left-hand side trees. For example,
56 with alternatives (aka "sums"), the left-hand side class is abstract: only
73 zero-or-more values (marked with an asterisk), the values are represented
85 are the first and last line numbers of source text span (1-indexed so the
87 are the corresponding UTF-8 byte offsets of the first and last tokens that
88 generated the node. The UTF-8 offset is recorded because the parser uses
89 UTF-8 internally.
93 one can get the source segment of a one-line expression node using
168 Node representing a single formatting field in an f-string. If the string
176 * -1: no formatting
188 An f-string, comprising a series of :class:`FormattedValue` and :class:`Constant`
200 conversion=-1),
208 conversion=-1,
359 >>> print(ast.dump(ast.parse('-a'), indent=4))
669 each element - typically a :class:`Name` or :class:`Tuple` node. ``iter``
1204 typically a :class:`Name` node (or ``None`` for a catch-all ``except:`` clause).
1519 all positional patterns match the corresponding class-defined attributes, and
1575 A match "as-pattern", capture pattern or wildcard pattern. ``pattern``
1616 A match "or-pattern". An or-pattern matches each of its subpatterns in turn
1617 to the subject, until one succeeds. The or-pattern is then deemed to
1618 succeed. If none of the subpatterns succeed the or-pattern fails. The
1697 * ``kw_defaults`` is a list of default values for keyword-only arguments. If
1719 ... def f(a: 'annotation', b=1, c=2, *d, e, f=3, **g) -> 'return annotation':
1828 Other keywords will be passed to the metaclass, as per `PEP-3115
1829 <https://peps.python.org/pep-3115/>`_.
1917 ------------------
1939 e.g. ``(str, int) -> List[str]``.
2001 what that meant. That was misleading. This is specifically designed not to
2032 If *clean* is true, clean up the docstring's indentation with
2045 If *padded* is ``True``, the first line of a multi-line statement will
2162 the new sub-tree to recalculate the location information::
2182 If *indent* is a non-negative integer or string, then the tree will be
2183 pretty-printed with that indent level. An indent level
2193 .. _ast-compiler-flags:
2196 --------------
2203 Enables support for top-level ``await``, ``async for``, ``async with``
2221 .. _ast-cli:
2223 Command-Line Usage
2224 ------------------
2231 .. code-block:: sh
2233 python -m ast [-m <mode>] [-a] [infile]
2239 .. cmdoption:: -h, --help
2243 .. cmdoption:: -m <mode>
2244 --mode <mode>
2249 .. cmdoption:: --no-type-comments
2253 .. cmdoption:: -a, --include-attributes
2257 .. cmdoption:: -i <indent>
2258 --indent <indent>
2260 Indentation of nodes in AST (number of spaces).
2271 `ASTTokens <https://asttokens.readthedocs.io/en/latest/user-guide.html>`_
2276 `leoAst.py <https://leoeditor.com/appendices.html#leoast-py>`_ unifies the
2277 token-based and parse-tree-based views of python programs by inserting
2278 two-way links between tokens and ast nodes.
2286 error recovery and round-trip parsing for different Python versions (in