:orphan: .. _s_11PytoRuntime10MethodBodya: ``MethodBody`` ============== A Swift function callable from Python. .. raw:: html .. rubric:: Declaration .. raw:: html
typealias MethodBody = (
       Object,
       ArgumentParser
   ) throws -> (
       any Parsable
   )?
   
.. rubric:: Discussion Expected by :swift:symbol:`PytoRuntime.Method` as the Swift side of a Python function. .. rubric:: Parameters The first parameter is the receiver of the method, which can be a module, an instance or a class depending on where the method was registered. The second one is an :swift:symbol:`PytoRuntime.ArgumentParser` which can be used to parse the passed arguments or retrieve them directly and get access to the owning module object if it is not the direct receiver. .. rubric:: Throws :swift:symbol:`PytoRuntime.Exception` errors will be raised as is in the Python stack. Any other kind of error will be wrapped in a :py:class::swift:symbol:`PytoRuntime.pyto_runtime.SwiftError`. .. rubric:: Returns Any :swift:symbol:`PytoRuntime.Parsable` value.