Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagelib
Path: blob/master/sage/ext/c_lib.pyx
4048 views
1
r"""
2
Interface between Python and c_lib.
3
4
This allows Python code to access a few parts of c_lib. This is not
5
needed for Cython code, since such code can access c_lib directly.
6
7
8
AUTHORS:
9
10
- Jeroen Demeyer (2010-10-13): initial version
11
12
"""
13
#*****************************************************************************
14
# Copyright (C) 2011 Jeroen Demeyer <[email protected]>
15
#
16
# Distributed under the terms of the GNU General Public License (GPL)
17
# as published by the Free Software Foundation; either version 2 of
18
# the License, or (at your option) any later version.
19
# http://www.gnu.org/licenses/
20
#*****************************************************************************
21
22
include '../ext/stdsage.pxi'
23
include '../ext/interrupt.pxi'
24
25
def _init_csage():
26
"""
27
Call init_csage().
28
29
This is normally done exactly once during Sage startup from
30
sage/all.py
31
"""
32
init_csage()
33
34
35
def sig_on_count():
36
"""
37
Return _signals.sig_on_count.
38
39
This is normally zero, but increased by every sig_on() or sig_str()
40
and decreased by every sig_off(). In pure Python code, this should
41
always be zero.
42
43
EXAMPLES::
44
45
sage: sig_on_count()
46
0
47
"""
48
return _signals.sig_on_count
49
50