init(name:doc:signature:decorators:body:)

Initializes the method definition.

Declaration

init(
    name: String,
    doc: String? = nil,
    signature: @escaping
    (
        () throws -> Signature
    ) = { Signature.empty },
    decorators: @escaping
    (
        () -> [Object?]
    ) = { return[] },
    body: @escaping
    MethodBody
)

Parameters

  • name: The name of the method.

  • doc: The docstring of the method.

  • signature: A closure returning the method’s signature.

  • decorators: Decorators wrapping the method.

  • body: The body of the method called by Python.