On 2015-09-06 22:38, Simon King wrote:
Would you say that <interface>.version() should be consistent in the
type of the return value, i.e., that it should always return a string?
Or do you think it is ok that some interfaces return a string, some
return a pair formed by a tuple and a string, some return an interface
element that looks like a list?

Well, most importantly, I think that package-version.txt should *not* be used. Especially in the light of future packaging efforts, we should not use anything from the $SAGE_ROOT/build directory at runtime.

My vote for the version number goes to this:

sage: gp.version()
((2, 8, 0), 'GP/PARI CALCULATOR Version 2.8.0 (development git-489005a)')

because the tuple gp.version()[0] can be used like

sage: gp.version()[0] >= (2,8,0)
True

and there is also a human-readable string gp.version()[1] which can be used for display purposes.

Alternatively, we could have two functions

sage: gp.version()
'GP/PARI CALCULATOR Version 2.8.0 (development git-489005a)'
sage: gp.version_tuple()
(2, 8, 0)

--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to