178
178
179
179
sage: # optional - gap3
180
180
sage: gap3.load_package("chevie")
181
- sage: gap3.version() # random
181
+ sage: gap3.version() # random # not tested
182
182
'lib: v3r4p4 1997/04/18, src: v3r4p0 1994/07/10, sys: usg gcc ansi'
183
183
184
184
Working with GAP3 lists. Note that GAP3 lists are 1-indexed::
@@ -302,11 +302,12 @@ def __init__(self, command=gap3_cmd):
302
302
303
303
EXAMPLES::
304
304
305
- sage: gap3 = Gap3() #optional - gap3
305
+ sage: # optional - gap3
306
+ sage: gap3 = Gap3()
306
307
sage: gap3.is_running()
307
308
False
308
- sage: gap3._start() #optional - gap3
309
- sage: gap3.is_running() #optional - gap3
309
+ sage: gap3._start()
310
+ sage: gap3.is_running()
310
311
True
311
312
"""
312
313
self .__gap3_command_string = command
@@ -341,18 +342,20 @@ def _start(self):
341
342
342
343
EXAMPLES::
343
344
344
- sage: gap3 = Gap3() #optional - gap3
345
+ sage: # optional - gap3
346
+ sage: gap3 = Gap3()
345
347
sage: gap3.is_running()
346
348
False
347
- sage: gap3._start() #optional - gap3
348
- sage: gap3.is_running() #optional - gap3
349
+ sage: gap3._start()
350
+ sage: gap3.is_running()
349
351
True
350
352
351
353
Check that :trac:`23142` is fixed::
352
354
353
- sage: gap3.eval("1+1") #optional - gap3
355
+ sage: # optional - gap3
356
+ sage: gap3.eval("1+1")
354
357
'2'
355
- sage: gap3.quit() #optional - gap3
358
+ sage: gap3.quit()
356
359
"""
357
360
Expect ._start (self )
358
361
# The -p command-line option to GAP3 produces the following
@@ -504,7 +507,7 @@ def help(self, topic, pager=True):
504
507
E .expect_list (self ._compiled_small_pattern )
505
508
506
509
# merge the help text into one string and print it.
507
- helptext = "" .join (helptext ).strip ()
510
+ helptext = "" .join (bytes_to_str ( line ) for line in helptext ).strip ()
508
511
if pager is True :
509
512
from sage .misc .pager import pager as pag
510
513
pag ()(helptext )
@@ -513,8 +516,9 @@ def help(self, topic, pager=True):
513
516
514
517
def cputime (self , t = None ):
515
518
r"""
516
- Returns the amount of CPU time that the GAP session has used in
517
- seconds. If ``t`` is not None, then it returns the difference
519
+ Return the amount of CPU time that the GAP session has used in seconds.
520
+
521
+ If ``t`` is not None, then it returns the difference
518
522
between the current CPU time and ``t``.
519
523
520
524
EXAMPLES::
0 commit comments