MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / block

Method block

tools/python-3.11.9-amd64/Lib/ast.py:744–755  ·  view source on GitHub ↗

A context manager for preparing the source for blocks. It adds the character':', increases the indentation on enter and decreases the indentation on exit. If *extra* is given, it will be directly appended after the colon character.

(self, *, extra = None)

Source from the content-addressed store, hash-verified

742
743 @contextmanager
744 def block(self, *, extra = None):
745 """A context manager for preparing the source for blocks. It adds
746 the character':', increases the indentation on enter and decreases
747 the indentation on exit. If *extra* is given, it will be directly
748 appended after the colon character.
749 """
750 self.write(":")
751 if extra:
752 self.write(extra)
753 self._indent += 1
754 yield
755 self._indent -= 1
756
757 @contextmanager
758 def delimit(self, start, end):

Callers 11

do_visit_tryMethod · 0.95
visit_ExceptHandlerMethod · 0.95
visit_ClassDefMethod · 0.95
_function_helperMethod · 0.95
_for_helperMethod · 0.95
visit_IfMethod · 0.95
visit_WhileMethod · 0.95
visit_WithMethod · 0.95
visit_AsyncWithMethod · 0.95
visit_MatchMethod · 0.95
visit_match_caseMethod · 0.95

Calls 1

writeMethod · 0.95

Tested by

no test coverage detected