Class FunctionObject::FunctionObject

A function object, whether written in Python or builtin

Direct supertypes

Indirect supertypes

Known direct subtypes

Predicates

descriptiveString

Gets a longer, more descriptive version of toString()

getACall

Gets a call-site from where this function is called

getACall

Gets a call-site from where this function is called, given the context

getACallee

Gets a function that this function (directly) calls

getAFunctionCall

Gets a call-site from where this function is called as a function

getAMethodCall

Gets a call-site from where this function is called as a method

getARaisedType

Gets a class that may be raised by this function

getAnInferredReturnType

Gets a class that this function may return

getArgumentForCall

Gets the ControlFlowNode that will be passed as the nth argument to this when called at call. This predicate will correctly handle x.y(), treating x as the zeroth argument.

getFunction
getName

Gets the name of this function

getNamedArgumentForCall

Gets the ControlFlowNode that will be passed as the named argument to this when called at call. This predicate will correctly handle x.y(), treating x as the self argument.

getQualifiedName

Gets the qualified name for this function object. Should return the same name as the __qualname__ attribute on functions in Python 3.

isAbstract
isLegalArgumentName

Whether name is a legal argument name for this function

isNormalMethod

Whether this is a “normal” method, that is, it is exists as a class attribute which is not wrapped and not the new method.

isOverriddenMethod
isOverridingMethod
isProcedure

This function always returns None, meaning that its return value should be disregarded

maxParameters

Gets the maximum number of parameters that can be correctly passed to this function

minParameters

Gets the minimum number of parameters that can be correctly passed to this function

neverReturns

Whether this function never returns. This is an approximation.

prettyString

Use descriptiveString() instead.

raisesUnknownType

Whether this function raises an exception, the class of which cannot be inferred

Inherited predicates

booleanValue

The Boolean value of this object if it always evaluates to true or false. For example: false for None, true for 7 and no result for int(x)

from Object
getAnInferredType

Gets an inferred type for this object, without using inter-procedural analysis. WARNING: The lack of context makes this less accurate than f.refersTo(this, result, _) for a control flow node ‘f’

from Object
getOrigin

Gets the point in the source code from which this object “originates”.

from Object
hasLocationInfofrom Object
hasLongName

Holds if this object can be referred to by longName For example, the modules dict in the sys module has the long name sys.modules and the name os.path.join will refer to the path joining function even though it might be declared in the posix or nt modules. Long names can have no more than three dots after the module name.

from Object
isBuiltin

Whether this a builtin object. A builtin object is one defined by the implementation, such as the integer 4 or by a native extension, such as a NumPy array class.

from Object
isC

Retained for backwards compatibility. See Object.isBuiltin()

from Object
overrides

Whether this overrides o. In this context, “overrides” means that this object is a named attribute of a some class C and o is a named attribute of another class S, both attributes having the same name, and S is a super class of C.

from Object
simpleClass

Gets the class of this object for simple cases, namely constants, functions, comprehensions and built-in objects.

from Object
toStringfrom Object