Skip to content

Commit 644b5bb

Browse files
committed
Add all global context into this file
1 parent 4a16f0e commit 644b5bb

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/flint/flint_base/flint_context.pxd

+14
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,17 @@ cdef class FlintContext:
99
cdef arf_rnd_t rnd
1010
cdef public bint unicode
1111
cdef public long _cap
12+
13+
cdef FlintContext thectx
14+
15+
cdef inline long getprec(long prec=0):
16+
if prec > 1:
17+
return prec
18+
else:
19+
return thectx._prec
20+
21+
cdef inline long getcap(long cap=-1):
22+
if cap >= 0:
23+
return cap
24+
else:
25+
return thectx._cap

src/flint/flint_base/flint_context.pyx

+2
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,5 @@ cdef class FlintContext:
6868

6969
def cleanup(self):
7070
flint_cleanup()
71+
72+
cdef FlintContext thectx = FlintContext()

0 commit comments

Comments
 (0)