syft.ast.callable

This module contains Callable, an AST node representing a method (can be static), global function, or constructor which can be directly executed.

Classes

Callable(path_and_name, parent[, ...])

Represent a method (can be static), global function, or constructor which can be directly executed.

class syft.ast.callable.Callable(path_and_name, parent, object_ref=None, return_type_name=None, client=None, is_static=False)[source]

Bases: syft.ast.attribute.Attribute

Represent a method (can be static), global function, or constructor which can be directly executed.

__init__(path_and_name, parent, object_ref=None, return_type_name=None, client=None, is_static=False)[source]

Base constructor for Callable.

Parameters
  • path_and_name – The path for the current node, e.g. syft.lib.python.List.

  • parent – The parent node and it’s attributes in the AST.

  • object_ref – The actual python object for which the computation is being made.

  • return_type_name – The return type name of the given action as a string with its full path.

  • client – The client for which all computation is being executed.

  • is_static – If True, the object has to be resolved on the AST, not on an existing pointer.

add_path(path, index, return_type_name=None, framework_reference=None, is_static=False)[source]

The add_path adds new nodes in AST based on type of current node and type of object to be added.

Parameters
  • path – The node path added in AST, e.g. syft.lib.python.List or [“syft”, “lib”, “python”, “List].

  • index – The associated position in the path for the current node.

  • return_type_name – The return type name of the given action as a string with its full path.

  • framework_reference – The Python framework in which we can solve the same path to obtain the Python object.

  • is_static – If the node represents a static method.