Example #1
0
 def _define(main: gen.Block, name: str) -> gen.Function:
     return main.func(
         name,
         main.param("o"),
         main.param("lazy",
                    default=False,
                    kind=gen.ParameterKind.KEYWORD_ONLY),
         main.param("name",
                    default=None,
                    kind=gen.ParameterKind.KEYWORD_ONLY),
     )
Example #2
0
 def define(self, block: gen.Block, name: str) -> gen.Function:
     f: gen.Function = block.f(
         name,
         block.param(self.VALUE, annotation="VT"),
         block.param(
             "field",
             annotation=str,
             kind=gen.ParameterKind.KEYWORD_ONLY,  # type: ignore
             default=None,
         ),
     )
     return f