singlecallbackmethod

Defined in module: wield.declarative.callbacks.callbacks.singlecallbackmethod

class singlecallbackmethod(fget, doc=None)[source][github]

Bases: object

Like callbackmethod, but is used for singlecallbacks.

Parameters:
  • fget – function to wrap as the default with docstring

  • doc – (optional) provide this as the docstring rather than using fget’s

Wraps the decorator function with a SingleCallback, providing the wrapped function as the default (not called once the callback is set). This is mostly useful for providing docstrings to callback methods.

Internally this works by constructing a callback object and memoizing it to preserve any callbacks added to it.

This type is a descriptor(non-data). It is intended to be used via the decorator syntax.

__init__(fget, doc=None)[source][github]

Methods

__init__(fget[, doc])