Skip to content

Commit 08bc2f9

Browse files
committed
Add version() method returning a Python tuple
1 parent 0e36a59 commit 08bc2f9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

cypari2/pari_instance.pyx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,19 @@ cdef class Pari(Pari_auto):
770770
def get_series_precision(self):
771771
return precdl
772772

773+
def version(self):
774+
"""
775+
Return the PARI version as tuple with 3 or 4 components:
776+
(major, minor, patch) or (major, minor, patch, VCSversion).
777+
778+
Examples:
779+
780+
>>> from cypari2 import Pari
781+
>>> Pari().version() >= (2, 9, 0)
782+
True
783+
"""
784+
return tuple(Pari_auto.version(self))
785+
773786
def complex(self, re, im):
774787
"""
775788
Create a new complex number, initialized from re and im.

0 commit comments

Comments
 (0)