Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
""" Operations for LibGAP Elements
GAP functions for which several methods can be available are called operations, so GAP ``Size`` is an example of an operation. This module is for inspecting GAP operations from Python. In particular, it can list the operations that take a particular LibGAP element as first argument. This is used in tab completion, where Python ``x.[TAB]`` lists all GAP operations for which ``Operation(x, ...)`` is defined. """
""" Information about operations that can act on a given LibGAP element
INPUT:
- ``libgap_element`` -- libgap element.
EXAMPLES::
sage: from sage.libs.gap.operations import OperationInspector sage: OperationInspector(libgap(123)) Operations on 123 """
""" Return the string representation
OUTPUT:
String
EXAMPLES:
sage: from sage.libs.gap.operations import OperationInspector sage: opr = OperationInspector(libgap(123)) sage: opr._repr_() 'Operations on 123' """
def obj(self): """ The first argument for the operations
OUTPUT:
A Libgap object.
EXAMPLES::
sage: from sage.libs.gap.operations import OperationInspector sage: x = OperationInspector(libgap(123)) sage: x.obj 123 """
""" Return the GAP operations for :meth:`obj`
OUTPUT:
List of GAP operations
EXAMPLES::
sage: from sage.libs.gap.operations import OperationInspector sage: x = OperationInspector(libgap(123)) sage: Unknown = libgap.function_factory('Unknown') sage: Unknown in x.operations() True """
""" Return the names of the operations
OUTPUT:
List of strings
EXAMPLES::
sage: from sage.libs.gap.operations import OperationInspector sage: x = OperationInspector(libgap(123)) sage: 'Sqrt' in x.op_names() True """ else:
|