@@ -27,7 +27,7 @@ This saves a dictionary with ``w`` as one of the keys::
27
27
28
28
sage: z = load( os. path. join( d. name, 'session'))
29
29
sage: list( z)
30
- ['d ', 'w ' ]
30
+ ['w ', 'd ' ]
31
31
sage: z['w' ]
32
32
2/3
33
33
@@ -200,7 +200,7 @@ def show_identifiers(hidden=False):
200
200
sage: a = 10
201
201
sage: factor = 20
202
202
sage: show_identifiers( )
203
- ['a ', 'factor ' ]
203
+ ['factor ', 'a ' ]
204
204
205
205
To get the actual value of a variable from the list, use the
206
206
:func:`globals( ) ` function. ::
@@ -214,18 +214,21 @@ def show_identifiers(hidden=False):
214
214
215
215
sage: _hello = 10
216
216
sage: show_identifiers( )
217
- ['a ', 'factor ' ]
217
+ ['factor ', 'a ' ]
218
218
sage: '_hello' in show_identifiers( hidden=True)
219
219
True
220
220
221
221
Many of the hidden variables are part of the IPython command history, at
222
222
least in command line mode. ::
223
223
224
224
sage: show_identifiers( hidden=True) # random output
225
- ['__', '_i', '_6', '_4', '_3', '_1', '_ii', '__doc__', '__builtins__', '___', '_9', '__name__', '_', 'a', '_i12', '_i14', 'factor', '__file__', '_hello', '_i13', '_i11', '_i10', '_i15', '_i5', '_13', '_10', '_iii', '_i9', '_i8', '_i7', '_i6', '_i4', '_i3', '_i2', '_i1', '_init_cmdline', '_14' ]
225
+ ['__builtin__', '_ih', '_oh', '_dh', 'exit', 'quit', '_', '__', '___',
226
+ '_i', '_ii', '_iii', '_i1', 'factor', '_i2', '_2', '_i3', 'a', '_i4',
227
+ '_i5', '_5', '_i6', '_6', '_i7', '_hello', '_i8', '_8', '_i9', '_9',
228
+ '_i10' ]
226
229
"""
227
230
state = caller_locals()
228
- return sorted ( [x for x, v in state.items() if _is_new_var(x, v, hidden)])
231
+ return [x for x, v in state.items() if _is_new_var(x, v, hidden)]
229
232
230
233
231
234
def save_session (name = ' sage_session' , verbose = False ):
@@ -288,17 +291,15 @@ def save_session(name='sage_session', verbose=False):
288
291
sage: f = lambda x : x^ 2
289
292
sage: save_session( tmp_f)
290
293
sage: save_session( tmp_f, verbose=True)
291
- Saving...
292
- Not saving f: f is a function or method
293
294
...
295
+ Not saving f: f is a function or method
294
296
295
297
Something similar happens for cython-defined functions::
296
298
297
299
sage: g = cython_lambda( 'double x', 'x* x + 1. 5')
298
300
sage: save_session( tmp_f, verbose=True)
299
- Saving...
300
- Not saving g: g is a cython function or method
301
301
...
302
+ Not saving g: g is a cython function or method
302
303
303
304
And the same for a lazy import::
304
305
@@ -307,7 +308,6 @@ def save_session(name='sage_session', verbose=False):
307
308
sage: save_session( tmp_f, verbose=True)
308
309
...
309
310
Not saving lazy_ZZ: lazy_ZZ is a lazy import
310
- ...
311
311
"""
312
312
state = caller_locals()
313
313
# This dict D will contain the session -- as a dict -- that we will save to disk.
0 commit comments