1.2.6Class Function

Metaclass for Falcon function type.

Class Function from \
                 BOM( )
Methods
attributesReturns a dictionary containing annotation attributes of the given function.
callerGets the direct caller or one of the calling ancestors.
nameGets the symbolic name of the given function.
stackGets a string representation of the call stack.
traceGets a trace step in the call stack.
Methods inherited from class BOM
__addOverrides binary addition operand.
__callOverrides call operator "self()".
__decOverrides decrement unary prefix operand.
__decpostOverrides decrement unary postfix operand.
__divOverrides binary division operand.
__getIndexOverrides array access operator []
__incOverrides increment unary prefix operand.
__incpostOverrides increment unary postifx operand.
__modOverrides modulo operand.
__mulOverrides binary multiplication operand.
__powOverrides power operand.
__setIndexOverrides array write operator []
__subOverrides binary subtraction operand.
baseClassReturns the class item from which an object has been instantiated.
boundDetermines if an item is bound or not.
classNameReturns the name of the class an instance is instantiated from.
clonePerforms a deep copy of the item.
comparePerforms a lexicographical comparison.
derivedFromChecks if this item has a given parent.
describeReturns the deep contents of an item on a string representation.
isCallableDetermines if an item is callable.
lenRetrieves the length of a collection
metaclassReturns the metaclass associated with this item.
ptrReturns a raw memory pointer out of this data (as an integer).
serializeSerialize the item on a stream for persistent storage.
toStringCoverts the object to string.
typeIdReturns an integer indicating the type of this item.

Methods

attributes

Returns a dictionary containing annotation attributes of the given function.

Function.attributes()
ReturnNil if the function has no attributes, or a string-indexed dictionary.

See also: attributes.

caller

Gets the direct caller or one of the calling ancestors.

Function.caller( [level] )
level Caller level (starting from zero, the default).
ReturnThe item having performed the nth call.

This function returns the n-th caller (zero based) that caused this function to be called. It may be a function, a method or another callable item from which the call has originated.

Note: The method can also be called statically on the Function metaclass.

name

Gets the symbolic name of the given function.

Function.name()
ReturnA string containing the function name

This is useful if the function symbol or has been re-assigned to temporary variables, or if it is applied to the fself keyword.

stack

Gets a string representation of the call stack.

Function.stack()
ReturnA string containing all the stack trace up to this point.

The returned string looks like the stack trace printed by errors, but is referred to the call stack up to the function from which this method is called.

Note: The method can also be called statically on the Function metaclass.

trace

Gets a trace step in the call stack.

Function.trace( [level] )
level Caller level (starting from zero, the default).
ReturnAn array containing the data relative to the given trace level.

The returned data is organized as follows:


   [ 'symbol name', 'module name', 'module path', line_in_module, PC_in_vm]

Note: The method can also be called statically on the Function metaclass.

Made with http://www.falconpl.org