heyoka.func_args#
- class heyoka.func_args#
Class to represent sets of function arguments.
Added in version 8.0.0.
This class is used to represent the arguments of a function
expression
. The arguments are stored internally as alist
ofexpression
and they can be accessed via theargs
property.Upon construction, the user can select whether the arguments are stored using value or reference semantics. In the former case, when the
func_args
instance is copied (either directly via the use of functions such ascopy()
/deepcopy()
or indirectly through theexpression
API), a new copy of the list of arguments is created for each newfunc_args
instance. In the latter case, multiple copies of afunc_args
contain references to a single shared instance of the list of arguments.The default behaviour throughout heyoka.py is to use value semantics. Reference semantics is used in specific situations where it can bring substantial performance benefits.
Methods
__init__
(self[, args, shared])Constructor.
Attributes
The list of function arguments.
Flag signalling the use of reference or value semantics.
- __init__(self, args: Iterable[expression] = [], shared: bool = False)#
Constructor.
This constructor will construct an instance of
func_args
storing the arguments args. If the boolean flag shared isTrue
, then reference semantics will be used, otherwise value semantics will be employed.- Parameters:
args – the input set of arguments.
shared – the boolean flag selecting value or reference semantics.
- property args#
The list of function arguments.
- Return type:
Flag signalling the use of reference or value semantics.
The flag is
True
if reference semantics is being used to represent the arguments,False
otherwise.- Return type: