Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
minor test fixes and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
embray committed Dec 7, 2018
1 parent e588e7a commit e11e438
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
17 changes: 9 additions & 8 deletions src/sage/libs/gap/element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2137,7 +2137,7 @@ cdef class GapElement_String(GapElement):
sage: s.sage()
'string'
sage: type(_)
<... 'str'>
<type 'str'>
"""
s = char_to_str(CSTR_STRING(self.value))
return s
Expand Down Expand Up @@ -2903,7 +2903,8 @@ cdef class GapElement_Record(GapElement):
sage: rec['no_such_element']
Traceback (most recent call last):
...
IndexError: libGAP: Error, Record: '<rec>.no_such_element' must have an assigned value
IndexError: libGAP: Error, Record Element: '<rec>.no_such_element' must
have an assigned value
"""

def __len__(self):
Expand Down Expand Up @@ -2937,7 +2938,7 @@ cdef class GapElement_Record(GapElement):
sage: iter = rec.__iter__()
sage: type(iter)
<type 'sage.libs.gap.element.GapElement_RecordIterator'>
sage: list(rec)
sage: sorted(rec)
[('a', 123), ('b', 456)]
"""
return GapElement_RecordIterator(self)
Expand Down Expand Up @@ -3041,7 +3042,7 @@ cdef class GapElement_RecordIterator(object):
EXAMPLES::
sage: rec = libgap.eval('rec(a:=123, b:=456)')
sage: list(rec)
sage: sorted(rec)
[('a', 123), ('b', 456)]
sage: dict(rec)
{'a': 123, 'b': 456}
Expand Down Expand Up @@ -3077,10 +3078,10 @@ cdef class GapElement_RecordIterator(object):
sage: rec = libgap.eval('rec(a:=123, b:=456)')
sage: iter = rec.__iter__()
sage: iter.__next__()
('a', 123)
sage: next(iter)
('b', 456)
sage: a = iter.__next__()
sage: b = next(iter)
sage: sorted([a, b])
[('a', 123), ('b', 456)]
"""
cdef UInt i = self.i
if i>len(self.rec):
Expand Down
3 changes: 1 addition & 2 deletions src/sage/libs/gap/libgap.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ from sage.misc.superseded import deprecated_function_alias
### Debugging ##############################################################
############################################################################


cdef void report(Obj bag):
print(TNAM_OBJ(bag), <int>SIZE_OBJ(bag))

Expand All @@ -237,8 +238,6 @@ cdef void print_gasman_objects():
CallbackForAllBags(report)




from sage.misc.lazy_import import is_during_startup
if is_during_startup():
import sys, traceback
Expand Down
2 changes: 1 addition & 1 deletion src/sage/libs/gap/util.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ from sage.cpython.string cimport str_to_bytes, char_to_str
from sage.interfaces.gap_workspace import prepare_workspace_dir
from sage.env import SAGE_LOCAL, GAP_ROOT_DIR

# these do nothing now

############################################################################
### Hooking into the GAP memory management #################################
############################################################################


cdef class ObjWrapper(object):
"""
Wrapper for GAP master pointers
Expand Down

0 comments on commit e11e438

Please sign in to comment.