module documentation

Undocumented

Function bindable Mark a method as a "bindable" method.
Function modified Annotate a callable as a modified wrapper of an original callable.
Function named Change the name of a function to the given name.
Function originalName Get the original, user-specified name of function, chasing back any wrappers applied with modified.
Constant C Undocumented
def bindable(bindable): (source)

Mark a method as a "bindable" method.

If a Klein.app resource is found on an instance object (i.e. is returned from YourObject().app.resource()), it will pass self from that instance to all of its routes, making a signature of 2 arguments: self and request However, if it's found globally (i.e. app = Klein(); @app.route(...) at global scope), then it will only receive one: request. However, for decorators that must be able to live between @route and the user's function, but still need to manipulate the request object, they need to be invoked with a consistent argument signature. A method decorated with @bindable will therefore always take instance, request as its first two arguments, even if instance is None when the Klein object is not bound to an instance.

Parameters
bindable:CUndocumented
Returns
Cits argument, modified to mark it as unconditionally requiring an instance argument.
def modified(modification, original, modifier=None): (source)

Annotate a callable as a modified wrapper of an original callable.

Parameters
modification:strA name for the type of modification, for example "form processor" or "request forwarder"; this will be tacked on to the name of the resulting function.
original:CallableUndocumented
modifier:Optional[Callable]Another decorator which, if given, will be applied to the function that decorates this function. Additionally, any new attributes set on the decorated function by modifier will be copied to original. This allows attributes set by "inner" decorators such as klein.Form.handler and klein.app.Klein.route to set attributes that will be visible at the top level.
Returns
CallableA new callable; this may have a different argument signature or return value, and is only related to original in the sense that it likely calls it.
def named(name): (source)

Change the name of a function to the given name.

Parameters
name:strUndocumented
Returns
Callable[[C], C]Undocumented
def originalName(function): (source)

Get the original, user-specified name of function, chasing back any wrappers applied with modified.

Parameters
function:CallableUndocumented
Returns
strUndocumented

Undocumented

Value
TypeVar('C',
        bound=Callable)