Utility functions for GAP

exception sage.libs.gap.util.GAPError[source]

Bases: ValueError

Exceptions raised by the GAP library

class sage.libs.gap.util.ObjWrapper[source]

Bases: object

Wrapper for GAP master pointers.

EXAMPLES:

sage: from sage.libs.gap.util import ObjWrapper
sage: x = ObjWrapper()
sage: y = ObjWrapper()
sage: x == y
True
>>> from sage.all import *
>>> from sage.libs.gap.util import ObjWrapper
>>> x = ObjWrapper()
>>> y = ObjWrapper()
>>> x == y
True
sage.libs.gap.util.gap_sig_off()[source]
sage.libs.gap.util.gap_sig_on()[source]
sage.libs.gap.util.get_owned_objects()[source]

Helper to access the refcount dictionary from Python code

sage.libs.gap.util.kernel_info()[source]

Return the GAP version, architecture, and root paths in a tuple.

The first two are used as cache keys to invalidate old workspaces in sage.interfaces.gap_workspace.gap_workspace_file. The root paths are required to initialize libgap. In the past we computed the root paths at build-time, but that may not work if (say) the build and target hosts have different libdirs.

This is fast enough that it should suffice until a more reliable method is available (GAP Github issue 6252).

OUTPUT:

A tuple containing three strings:

  1. The GAP version

  2. The GAP architecture

  3. A semicolon-delimited list of GAP’s RootPaths